コード例 #1
0
        public void DeadDummyShouldGiveExperiance()
        {
            var dummy = new Dummy(0, 50);

            dummy.GiveExperience();
            Assert.That(dummy.GiveExperience(), Is.EqualTo(50));
        }
コード例 #2
0
        public void DeadDummyGivesExperience()
        {
            dummy.TakeAttack(dummy.Health);
            int experience = dummy.GiveExperience();

            Assert.That(experience == DummyExperience, "Dead dummy does not give standart dummy experience");
        }
コード例 #3
0
        public void DeadDummyGivesXP()
        {
            hero.Attack(dummy);
            hero.Attack(dummy);

            Assert.AreEqual(10, dummy.GiveExperience(), "Dummy doesn't dive XP when dead");
        }
コード例 #4
0
        public void DeadDummyCanGiveXp()
        {
            //Act
            dummy.TakeAttack(DamageTaken);
            dummy.TakeAttack(DamageTaken);

            //Assert
            Assert.That(dummy.GiveExperience(), Is.EqualTo(DummyXp), "Dummy should be dead and give Xp!");
        }
コード例 #5
0
ファイル: DummyTests.cs プロジェクト: delbusque/SoftUni
        public void AliveDummyCantGiveExperience()
        {
            target = new Dummy(20, 100);

            Assert.That(() => target.GiveExperience(), Throws.InvalidOperationException
                        .With.Message.EqualTo("Target is not dead."));
        }
コード例 #6
0
ファイル: DummyTests.cs プロジェクト: delbusque/SoftUni
        public void DeadDummyGivesExperience()
        {
            target = new Dummy(0, 100);
            int experience = target.GiveExperience();

            Assert.That(experience, Is.EqualTo(100));
        }
コード例 #7
0
 public void AliveDummyShouldNotBeAbletoGiveXP()
 {
     //Arrange
     dummy = new Dummy(20, 20);
     //Act-Assert
     Assert.Throws <InvalidOperationException>(() => dummy.GiveExperience());
 }
コード例 #8
0
        public void GiveExperience_Alive_ThrowsInvalidOperationException()
        {
            Dummy dummy = new Dummy(5, 5);

            Assert.Throws <InvalidOperationException>(() => dummy.GiveExperience(),
                                                      "Alive Dummy can give XP.");
        }
コード例 #9
0
        public void AliveDummyCannotGiveExperience()
        {
            Dummy dummy = new Dummy(10, 20);

            Assert.That(() => dummy.GiveExperience(),
                        Throws.InvalidOperationException.With.Message.EqualTo("Target is not dead."),
                        "Alive Dummy can't give experience");
        }
コード例 #10
0
        public void CheckIfDeadDummyCanGiveExp()
        {
            Dummy dummy = new Dummy(0, 10);

            int exp = dummy.GiveExperience();

            Assert.That(exp, Is.EqualTo(10));
        }
コード例 #11
0
ファイル: DummyTest.cs プロジェクト: vesy53/SoftUni
        public void AliveDummyCantGiveXp()
        {
            Dummy dummy = new Dummy(10, 10);

            Assert
            .Throws <InvalidOperationException>(
                () => dummy.GiveExperience());
        }
コード例 #12
0
        public void DeathDummyCanGiveXP()
        {
            Dummy dummy = new Dummy(0, 10);

            int actual   = dummy.GiveExperience();
            int expected = 10;

            Assert.AreEqual(expected, actual);
        }
コード例 #13
0
        public void DeadDummyCanGiveXP()
        {
            dummy = new Dummy(0, 123);

            var actualResult   = dummy.GiveExperience();
            var expectedResult = 123;

            Assert.AreEqual(expectedResult, actualResult);
        }
コード例 #14
0
        public void DeadDummyShouldBeAbleToGiveXP()
        {
            var initializeHealth     = 0;
            var initializeExperience = 10;

            var dummy = new Dummy(initializeHealth, initializeExperience);

            Assert.That(dummy.GiveExperience(), Is.EqualTo(initializeExperience));
        }
コード例 #15
0
        public void TestIfAliveDummyCantGiveXP()
        {
            //Arrange
            Dummy dummy = new Dummy(30, 50);

            //Act

            //Assert
            Assert.Throws <InvalidOperationException>(() => dummy.GiveExperience());
        }
コード例 #16
0
        public void CheckIfAliveDummyCantGiveXP()
        {
            Dummy dummy = new Dummy(10, 10);

            dummy.TakeAttack(3);

            Assert.That(() => dummy.GiveExperience(),
                        Throws.InvalidOperationException
                        .With.Message.EqualTo("Target is not dead."));
        }
コード例 #17
0
        public void DeadDummyShouldGiveXP(int health, int experience)
        {
            // Arrange
            dummy = new Dummy(0, 20);
            // Act
            int exp = dummy.GiveExperience();

            // Assert
            Assert.That(exp.Equals(experience));
        }
コード例 #18
0
ファイル: DummyTests.cs プロジェクト: nikolayvutov/CSharp
        public void AliveDummy_ThrowsExeption_IfGiveXP()
        {
            Dummy dummy = new Dummy(0, 20);

            dummy.GiveExperience();

            Assert.AreEqual(true, dummy.IsDead());

            //Assert.That(dummy.IsDead(), Throws.ArgumentException
            //.With.Message.EqualTo("Alive dummy can't give XP!"));
        }
コード例 #19
0
        public void AliveDummyShouldntBeAbleToGiveXP()
        {
            var initializeHealth         = 5;
            var initializeExperience     = 10;
            var expectedExceptionMessage = "Target is not dead.";

            var dummy = new Dummy(initializeHealth, initializeExperience);

            Assert.That(() => dummy.GiveExperience(),
                        Throws.InvalidOperationException.With.Message.EqualTo(expectedExceptionMessage));
        }
コード例 #20
0
        public void GiveExperience_Dead_GivesCorrectAmount()
        {
            int expectedResult = 5;

            Dummy dummy = new Dummy(0, expectedResult);

            int actualResult = dummy.GiveExperience();

            Assert.That(actualResult, Is.EqualTo(expectedResult),
                        "Dead Dummy does not give correct amount of XP.");
        }
コード例 #21
0
ファイル: DummyTest.cs プロジェクト: vesy53/SoftUni
        public void DeadDummyCanGivXP()
        {
            Dummy dummy = new Dummy(0, 10);

            int expectedExperience = 10;
            int actualExperience   = dummy.GiveExperience();

            int health = dummy.Health;

            Assert.AreEqual(expectedExperience, actualExperience);
            Assert.Zero(health);
        }
コード例 #22
0
ファイル: DummyTests.cs プロジェクト: viktorpavlov1/ITCareer
        // Мъртвото чучело може да даде XP
        public void DeadDummyGivesExperience()
        {
            // Arrange
            Axe   axe   = new Axe(10, 10);
            Dummy dummy = new Dummy(10, 10);

            // Act
            axe.Attack(dummy);

            // Assert
            Assert.AreEqual(10, dummy.GiveExperience());
        }
コード例 #23
0
ファイル: RefactorDummyTest.cs プロジェクト: vesy53/SoftUni
        public void DeadDummyCanGiveExperience(
            int healthDummy,
            int experienceDummy)
        {
            this.dummy = new Dummy(healthDummy, experienceDummy);

            int expectedExperience = DummyExperience;
            int actualExperience   = dummy.GiveExperience();

            Assert.AreEqual(expectedExperience, actualExperience,
                            "Alive dummy can give experience!");
        }
コード例 #24
0
        public void DeadDummyCanGiveExperience()
        {
            Dummy dummy        = new Dummy(DummyHealth, DummyExperience);
            int   AttackPoints = 10;

            while (!dummy.IsDead())
            {
                dummy.TakeAttack(AttackPoints);
            }

            var gotExperience = dummy.GiveExperience();

            Assert.AreEqual(gotExperience, DummyExperience);
        }
コード例 #25
0
        public void TestIfDeadDummyCanGiveXP()
        {
            //Arrange
            Dummy dummy = new Dummy(0, 12);

            //Act
            int actualExperience   = dummy.GiveExperience();
            int expectedExperience = 12;

            //Assert
            //Assert.That(actualExperience, Is.EqualTo(expectedExperience));

            Assert.AreEqual(actualExperience, expectedExperience,
                            "Dummy cannot give XP");
        }
コード例 #26
0
ファイル: DummyTests.cs プロジェクト: viktorpavlov1/ITCareer
        // Живото чучело не може да даде XP
        public void LiveDummyDoesNotGiveExperience()
        {
            // Arrange
            Axe   axe   = new Axe(1, 1);
            Dummy dummy = new Dummy(100, 1000);

            // Act
            axe.Attack(dummy);

            // Assert
            var exception = Assert.Throws <InvalidOperationException>
                            (
                () => dummy.GiveExperience() // Exception => Target is not dead.
                            );

            Assert.AreEqual(exception.Message, "Target is not dead.");
        }
コード例 #27
0
        public void TestReturnExp()
        {
            var test = new Dummy(0, 10);

            Assert.That(test.GiveExperience() == 10);
        }
コード例 #28
0
        public void TestGiveExperienceMethod()
        {
            dummy.TakeAttack(10);

            Assert.AreEqual(dummy.GiveExperience(), 10);
        }
コード例 #29
0
        public void DeadDummiesCanGiveExp()
        {
            axe.Attack(dummy);

            Assert.AreEqual(5, dummy.GiveExperience(), "Dead dummy does not give required amount of experience");
        }
コード例 #30
0
        public void DeadDummyCanGiveExpirience()
        {
            Dummy dummy = new Dummy(0, 10);

            Assert.That(() => dummy.GiveExperience(), Is.EqualTo(10), "Target is not dead.");
        }