public void CheckForWin_VerifyFunctionCalled() { var predicate = new MockFunc <bool>(); var state = CHECK_FOR_WIN(); StateTests <IGameState> .For(state) .When(() => state.CheckForWin(() => predicate.Run())) .Invoke(); predicate.VerifyFunctionCalled(); }
public void PlayAgain_VerifyFunctionReturnsFalse_StateChangesEnd() { var predicate = new MockFunc <bool>().RunReturns(true); var state = PLAY_AGAIN(); StateTests <IGameState> .For(state) .When(() => state.PlayAgain(() => predicate.Run())) .Invoke(); predicate.VerifyFunctionCalled(); }