Пример #1
0
        public void IsVisibleProperty_FalseByDefault()
        {
            GameOverPM systemUnderTest = new GameOverPM(Substitute.For <IStringTableManager>());

            bool isVisible = systemUnderTest.ViewModel.GetPropertyValue <bool>(GameOverPM.VISIBLE_PROPERTY);

            Assert.IsFalse(isVisible);
        }
Пример #2
0
        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> >());
        }
Пример #3
0
        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);
        }
Пример #4
0
        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));
        }
Пример #5
0
        public void WhenCreating_SubscribesToMessages()
        {
            GameOverPM systemUnderTest = new GameOverPM(Substitute.For <IStringTableManager>());

            MyMessenger.Instance.Received().AddListener <bool>(GameMessages.GAME_OVER, Arg.Any <Callback <bool> >());
        }
Пример #6
0
 void Start()
 {
     mPM = new GameOverPM(StringTableManager);
     SetModel(mPM.ViewModel);
 }