Пример #1
0
        public void OrcShouldDie()
        {
            MockGame mockGame = new MockGame();
            Orc weakOrc = new Orc(mockGame, 10);
            mockGame.ExpectHasDied(weakOrc);

            MockDie d20 = new MockDie();
            d20.AddRoll(18);
            d20.AddRoll(10);

            Player fighter = new Player(d20);
            fighter.Attack(weakOrc);

            Assert.IsTrue(weakOrc.IsDead());
            mockGame.Verify();
        }
Пример #2
0
        public void OrcShouldNotDie()
        {
            MockGame mockGame = new MockGame();
            Orc strongOrc = new Orc(mockGame, 30);

            MockDie d20 = new MockDie();
            d20.AddRoll(18);
            d20.AddRoll(10);

            Player fighter = new Player(d20);
            fighter.Attack(strongOrc);

            Assert.IsFalse(strongOrc.IsDead());
            mockGame.Verify();
        }