Пример #1
0
        public void AppliesToCommand_LeaveHouseCommand_ReturnsTrue()
        {
            LeaveHouseRule rule   = new LeaveHouseRule();
            bool           result = rule.AppliesToCommand(typeof(LeaveHouseCommand));

            Assert.IsTrue(result);
        }
Пример #2
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);
        }
Пример #3
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);
        }