Exemplo n.º 1
0
        public void Evaluate_MissingHeadwear_IsHot_ReturnsFalse()
        {
            Person person = new Person();

            person.Clothing.Add(new ClothingItem("", ClothingType.Pants));
            person.Clothing.Add(new ClothingItem("", ClothingType.Footwear));
            person.Clothing.Add(new ClothingItem("", ClothingType.Shirt));

            LeaveHouseRule rule   = new LeaveHouseRule();
            bool           result = rule.Evaluate(person, WeatherType.HOT);

            Assert.IsFalse(result);
        }
Exemplo n.º 2
0
        public void Evaluate_EverythingOn_IsCold_ReturnsTrue()
        {
            Person person = new Person();

            person.Clothing.Add(new ClothingItem("", ClothingType.Socks));
            person.Clothing.Add(new ClothingItem("", ClothingType.Pants));
            person.Clothing.Add(new ClothingItem("", ClothingType.Footwear));
            person.Clothing.Add(new ClothingItem("", ClothingType.Shirt));
            person.Clothing.Add(new ClothingItem("", ClothingType.Jacket));
            person.Clothing.Add(new ClothingItem("", ClothingType.Headwear));

            LeaveHouseRule rule   = new LeaveHouseRule();
            bool           result = rule.Evaluate(person, WeatherType.COLD);

            Assert.IsTrue(result);
        }