Exemple #1
0
        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));
        }
Exemple #2
0
        private IGameMonster GetMockMonsterWithIsDead(bool i_isDead)
        {
            IGameMonster mockMonster = Substitute.For <IGameMonster>();

            mockMonster.IsDead().Returns(i_isDead);

            return(mockMonster);
        }
Exemple #3
0
        private void SetShouldDestroyProperty()
        {
            bool shouldDestroy = mMonster.IsDead();

            ViewModel.SetProperty(DESTROY_PROPERTY, shouldDestroy);
        }