//for a bug raised where List matcher becomes confused with property matchers for
        //classes which have subclasses
        public void CanSubClassMatcherAndMatchOnSuperTypePocoTest()
        {
            IList <Employee> employees = new List <Employee>()
            {
                new Employee("Bob")
            };
            IList <Human> humans = new List <Human>()
            {
                new Human("Bob")
            };

            AssertPasses(
                humans,
                AList.InOrder().WithOnly(AHuman.With().Name("Bob"))
                );

            AssertPasses(
                employees,
                AList.InOrder().WithOnly(AnEmployee.With().Name("Bob"))
                );

            AssertPasses(
                employees,
                AList.InOrder().WithOnly(AHuman.With().Name("Bob"))
                );
        }
Exemplo n.º 2
0
 public void Attack(AHuman victim)
 {
     victim.Health -= Health * 5;
 }