Beispiel #1
0
        public void ShouldIncreaseHeathAfterSleeping_InRange()
        {
            var stu = new PlayerCharacter.PlayerCharacter {
                Health = 100
            };

            stu.Sleep();

            Assert.That(stu.Health, Is.InRange(101, 200));
        }
Beispiel #2
0
        public void ShouldIncreaseHeathAfterSleeping_returnTrue()
        {
            var stu = new PlayerCharacter.PlayerCharacter {
                Health = 100
            };

            stu.Sleep();

            Assert.That(stu.Health, Is.GreaterThan(100));
        }
Beispiel #3
0
        public void ReferenceEqualityDemo_ReturnFalse()
        {
            var player1 = new PlayerCharacter.PlayerCharacter();
            var player2 = new PlayerCharacter.PlayerCharacter();


            //Assert.That(player1, Is.SameAs(player2)); // this test should fail

            var player3 = player1;

            Assert.That(player1, Is.SameAs(player3)); // this test should pass
        }
Beispiel #4
0
        public void ShouldHaveAllTheExpectedWeapon_ReturnTrue()
        {
            var stu = new PlayerCharacter.PlayerCharacter();

            var expectedWeapons = new List <string>()
            {
                "Short sword",
                "Short bow",
                "Long bow"
            };

            Assert.That(stu.Weapons, Is.EquivalentTo(expectedWeapons));
        }
Beispiel #5
0
        public void ShouldHaveTwoBows()
        {
            var stu = new PlayerCharacter.PlayerCharacter();

            Assert.That(stu.Weapons, Has.Exactly(2).EndsWith("bow"));
        }
Beispiel #6
0
        public void ShouldHaveAtLeastOneKingSword()
        {
            var stu = new PlayerCharacter.PlayerCharacter();

            Assert.That(stu.Weapons, Has.Some.Contains("sword"));
        }
Beispiel #7
0
        public void ShouldHaveALongBow()
        {
            var stu = new PlayerCharacter.PlayerCharacter();

            Assert.That(stu.Weapons, Contains.Item("Long bow"));
        }
Beispiel #8
0
        public void ShouldHaveNoEmptyDeaultWeapons()
        {
            var stu = new PlayerCharacter.PlayerCharacter();

            Assert.That(stu.Weapons, Is.All.Not.Empty);
        }
Beispiel #9
0
        public void ShouldBeNewbie()
        {
            var stu = new PlayerCharacter.PlayerCharacter();

            Assert.That(stu.IsNoob, Is.True);
        }
Beispiel #10
0
        public void ShouldNotHaveNickName()
        {
            var stu = new PlayerCharacter.PlayerCharacter();

            Assert.That(stu.NickName, Is.Null);
        }
Beispiel #11
0
        public void ShouldHaveDefaultRandomGeneratedName()
        {
            var stu = new PlayerCharacter.PlayerCharacter();

            Assert.That(stu.Name, Is.Not.Empty);
        }
Beispiel #12
0
        public void CheckForStaffOfWander_ReturnTrue()
        {
            var stu = new PlayerCharacter.PlayerCharacter();

            Assert.That(stu.Weapons, Has.None.EqualTo("staff of wander"));
        }
Beispiel #13
0
        public void ShouldHaveNotMoreThanOneTypeOfAGivenWeapon()
        {
            var stu = new PlayerCharacter.PlayerCharacter();

            Assert.That(stu.Weapons, Is.Unique);
        }