Exemplo n.º 1
0
        public void ShouldIncreaseHeathAfterSleeping_InRange()
        {
            var stu = new PlayerCharacter.PlayerCharacter {
                Health = 100
            };

            stu.Sleep();

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

            stu.Sleep();

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

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

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

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

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

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

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

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

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

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