public void SetState_AnyState_ShouldActivateDeactivate() { // Arrange bool deactivateCalled = false; bool activateCalled = false; InitializeStateController(); Mock.Arrange(() => _placidState.Deactivate()).DoInstead(() => { deactivateCalled = true; }); Mock.Arrange(() => _hostileState.Activate()).DoInstead(() => { activateCalled = true; }); // Act _stateControllerInternal.SetState(_stateController.GetHostileState()); // Assert Assert.True(deactivateCalled); Assert.True(activateCalled); }
public void Die() { _stateController.SetState(_stateController.GetDeadState()); }