Exemple #1
0
        public void WhenDisposing_UnsubscribesToExpectedMessages()
        {
            GamePlayerPM systemUnderTest = new GamePlayerPM(Substitute.For <IGamePlayer>());

            systemUnderTest.Dispose();

            MyMessenger.Instance.Received().RemoveListener(GameMessages.UPDATE_PLAYER_HP, Arg.Any <Callback>());
        }
Exemple #2
0
        public void HpProperty_MatchesGamePlayerHP()
        {
            IGamePlayer mockPlayer = Substitute.For <IGamePlayer>();

            mockPlayer.HP.Returns(100);
            GamePlayerPM systemUnderTest = new GamePlayerPM(mockPlayer);

            Assert.AreEqual(100, systemUnderTest.ViewModel.GetPropertyValue <int>(GamePlayerPM.HP_PROPERTY));
        }