Esempio n. 1
0
        public void ApplyOnSkip_ShouldThrow_IfPassedICreaturesInBattleParameterIsNull()
        {
            ICreaturesInBattle creaturesInBattle = null;
            var addDefenseWhenSkip = new AddDefenseWhenSkip(5);

            var resultingException = Assert.Throws <ArgumentNullException>(() => addDefenseWhenSkip.ApplyOnSkip(creaturesInBattle));

            Assert.IsTrue(resultingException.Message.Contains("skipCreature"));
        }
Esempio n. 2
0
        public void ReturnCorrectPermanentDefense_WhenApplyOnSkipIsCalled()
        {
            var defenceWhenSkip = new AddDefenseWhenSkip(2);

            var creaturesInBattle = new CreaturesInBattle(new Angel(), 1);

            defenceWhenSkip.ApplyOnSkip(creaturesInBattle);

            Assert.AreEqual(22, creaturesInBattle.PermanentDefense);
        }
Esempio n. 3
0
        public void ApplyOnSkip_ShouldAccessICreaturesInBattlePermanentDefenseSetter()
        {
            var creaturesInBattle = new Mock <ICreaturesInBattle>();

            creaturesInBattle.SetupGet(creature => creature.PermanentDefense).Returns(0);
            creaturesInBattle.SetupSet(creature => creature.PermanentDefense = 0);

            var addDefenseWhenSkip = new AddDefenseWhenSkip(5);

            addDefenseWhenSkip.ApplyOnSkip(creaturesInBattle.Object);

            creaturesInBattle.Verify(creature => creature.PermanentDefense, Times.Once);
        }
Esempio n. 4
0
        public void ThrowArgumentNullException_ApplyOnSkipIsCalledWithNullCreature()
        {
            var defenceWhenSkip = new AddDefenseWhenSkip(2);

            Assert.Throws <ArgumentNullException>(() => defenceWhenSkip.ApplyOnSkip(null));
        }