public void WhenModelUpdated_IfMonsterIsDead_DestroyPropertyIsTrue() { IGameMonster mockMonster = Substitute.For <IGameMonster>(); mockMonster.IsDead().Returns(false); MonsterPM systemUnderTest = new MonsterPM(mockMonster); mockMonster.IsDead().Returns(true); mockMonster.ModelUpdated += Raise.Event <ModelUpdateHandler>(); Assert.AreEqual(true, systemUnderTest.ViewModel.GetPropertyValue <bool>(MonsterPM.DESTROY_PROPERTY)); }
private IGameMonster GetMockMonsterWithIsDead(bool i_isDead) { IGameMonster mockMonster = Substitute.For <IGameMonster>(); mockMonster.IsDead().Returns(i_isDead); return(mockMonster); }
private void SetShouldDestroyProperty() { bool shouldDestroy = mMonster.IsDead(); ViewModel.SetProperty(DESTROY_PROPERTY, shouldDestroy); }