INNER CODE UNIT · C++
state_event_count
AsPJT/PAX_SAPIENTICA · Projects/IntegrationTest/AppStateManagerTest.cpp:240
state_event_count = 0; // カウントをリセット
event_bus_.publish(SimulationPlayCommandEvent());
EXPECT_EQ(state_event_count, 1);
EXPECT_EQ(received_state, SimulationStateChangedEvent::State::Playing);
}
TEST_F(AppStateManagerTest, SimulationPauseCommandPublishesEvent) {
AppStateManager app_state{};
int state_event_count = 0;
SimulationStateChangedEvent::State received_state = SimulationStateChangedEvent::State::Stopped;
event_bus_.subscribe<SimulationStateChangedEvent>(
[&state_event_count, &received_state](const SimulationStateChangedEvent& event) {
state_event_count++;
received_state = event.new_state;