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

            stu.Sleep();

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

            stu.Sleep();

            Assert.That(stu.Health, Is.GreaterThan(100));
        }
示例#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
        }
示例#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));
        }
示例#5
0
        public void ShouldHaveTwoBows()
        {
            var stu = new PlayerCharacter.PlayerCharacter();

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

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

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

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

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

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

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

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

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