public void IsVisibleProperty_FalseByDefault() { GameOverPM systemUnderTest = new GameOverPM(Substitute.For <IStringTableManager>()); bool isVisible = systemUnderTest.ViewModel.GetPropertyValue <bool>(GameOverPM.VISIBLE_PROPERTY); Assert.IsFalse(isVisible); }
public void WhenDisposing_UnsubscribesFromMessages() { GameOverPM systemUnderTest = new GameOverPM(Substitute.For <IStringTableManager>()); systemUnderTest.Dispose(); MyMessenger.Instance.Received().RemoveListener <bool>(GameMessages.GAME_OVER, Arg.Any <Callback <bool> >()); }
public void AfterGameOverMessage_IfWin_IsVisibleFalse() { GameOverPM systemUnderTest = new GameOverPM(Substitute.For <IStringTableManager>()); systemUnderTest.OnGameOver(true); bool isVisible = systemUnderTest.ViewModel.GetPropertyValue <bool>(GameOverPM.VISIBLE_PROPERTY); Assert.IsFalse(isVisible); }
public void AfterGameOverMessage_BodyTextPropertyAsExpected(string i_expectedMessage, string i_key, bool i_won) { IStringTableManager mockStringTableManager = Substitute.For <IStringTableManager>(); mockStringTableManager.Get(i_key).Returns(i_expectedMessage); GameOverPM systemUnderTest = new GameOverPM(mockStringTableManager); systemUnderTest.OnGameOver(i_won); Assert.AreEqual(i_expectedMessage, systemUnderTest.ViewModel.GetPropertyValue <string>(GameOverPM.BODY_TEXT_PROPERTY)); }
public void WhenCreating_SubscribesToMessages() { GameOverPM systemUnderTest = new GameOverPM(Substitute.For <IStringTableManager>()); MyMessenger.Instance.Received().AddListener <bool>(GameMessages.GAME_OVER, Arg.Any <Callback <bool> >()); }
void Start() { mPM = new GameOverPM(StringTableManager); SetModel(mPM.ViewModel); }