예제 #1
0
        public void Attack_AttackingEmptyCharcater()
        {
            var    human          = new TestCharacters().InjuerdHuman;
            var    emptyCharacter = new Character();
            Action attack         = () => human.Attack(emptyCharacter);

            attack.ShouldThrow <NullReferenceException>();
        }
예제 #2
0
        public void Attack_NullAttack()
        {
            var human = new TestCharacters().InjuerdHuman;

            Action attack = () => human.Attack(null);

            attack.ShouldThrow <NullReferenceException>();
        }
예제 #3
0
        public void Attack_SelfAttack()
        {
            var human = new TestCharacters().InjuerdHuman;

            Action attack = () => human.Attack(human);

            attack.ShouldThrow <InvalidOperationException>().WithMessage("Character can not Attack it self!");
        }
예제 #4
0
        public void Attack_Human_Attacks_Elve()
        {
            var human = new TestCharacters().InjuerdHuman;
            var elve  = new TestCharacters().Elve;

            human.Attack(elve);

            elve.CurrentFluentAttributes.LifePoints.Should().BeLessOrEqualTo(11)
            .And.BeGreaterOrEqualTo(6);
        }
예제 #5
0
        public void Attack_EqiuppedElve_Attacks_Human()
        {
            var human = new TestCharacters().InjuerdHuman;
            var elve  = new TestCharacters().Elve;
            var sword = new TestItems().Sword;

            elve.Eqip(sword);
            elve.Attack(human);

            human.CurrentFluentAttributes.LifePoints.Should().BeLessOrEqualTo(0)
            .And.BeGreaterOrEqualTo(-5);
        }