public void WhenDisposing_UnsubscribesToExpectedMessages() { GamePlayerPM systemUnderTest = new GamePlayerPM(Substitute.For <IGamePlayer>()); systemUnderTest.Dispose(); MyMessenger.Instance.Received().RemoveListener(GameMessages.UPDATE_PLAYER_HP, Arg.Any <Callback>()); }
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)); }