Ejemplo n.º 1
0
 public void Should_Not_Accept_Invalid_Temperature()
 {
     Assert.Throws <NotValidTemperatureException>(() =>
     {
         var picker = new DressPicker("CLOUDY");
     });
 }
Ejemplo n.º 2
0
        public void Initial_State_is_with_Pajama_On(Temperature temperature)
        {
            var dressPicker = new DressPicker(temperature.ToString());

            Assert.IsTrue(dressPicker.IsPajamaOn);
            Assert.IsTrue(dressPicker.NumberOfDressesWeared == 1);
        }
Ejemplo n.º 3
0
        public void Shirt_Must_Be_Put_On_before_Headwear()
        {
            var dressPicker = new DressPicker(Temperature.Cold.ToString());

            dressPicker.Process((int)Command.TakeOffPajama);

            Assert.Throws <ShirtMustBePutOnBeforeHeadwearViolation>(() => dressPicker.Process((int)Command.PutOnHeadWear));
        }
Ejemplo n.º 4
0
        public void Only_One_Peice_Of_Socks_Can_Put_On()
        {
            var dressPicker = new DressPicker(Temperature.Cold.ToString());

            dressPicker.Process(((int)Command.TakeOffPajama));
            dressPicker.Process((int)Command.PutOnSocks);
            Assert.Throws <OnlyOnePieceOfEachClothingAllowedViolation>(() => dressPicker.Process((int)Command.PutOnSocks));
        }
Ejemplo n.º 5
0
        public void When_Hot_Cannot_Put_On_Socks()
        {
            var dressPicker = new DressPicker(Temperature.Hot.ToString());

            dressPicker.Process((int)Command.TakeOffPajama);

            Assert.Throws <CannotPutOnSocksWhenHotViolation>(() => dressPicker.Process((int)Command.PutOnSocks));
        }
Ejemplo n.º 6
0
        public void When_Cold_Can_Put_Socks()
        {
            var dressPicker = new DressPicker(Temperature.Cold.ToString());

            dressPicker.Process((int)Command.TakeOffPajama);

            Assert.AreEqual(Outfit.Socks.ToDescription(), dressPicker.Process((int)Command.PutOnSocks));
        }
Ejemplo n.º 7
0
        public void Pajama_Not_Found(Temperature temperature)
        {
            var dressPicker = new DressPicker(temperature.ToString());

            dressPicker.Process((int)Command.TakeOffPajama);

            Assert.Throws <PajamaNotFoundViolation>(() => dressPicker.Process((int)Command.TakeOffPajama));
        }
Ejemplo n.º 8
0
        public void When_Hot_TShirt_Can_Be_Put_On()
        {
            var dressPicker = new DressPicker(Temperature.Hot.ToString());

            dressPicker.Process((int)Command.TakeOffPajama);

            Assert.AreEqual(Outfit.Tshirt.ToDescription(), dressPicker.Process((int)Command.PutOnShirt));
        }
Ejemplo n.º 9
0
        public void Socks_Must_Be_Put_On_Before_Shoes()
        {
            var dressPicker = new DressPicker(Temperature.Cold.ToString());

            dressPicker.Process((int)Command.TakeOffPajama);
            dressPicker.Process((int)Command.PutOnPants);

            Assert.Throws <SocksMustBePutOnBeforeShoesViolation>(() => dressPicker.Process((int)Command.PutOnFootWear));
        }
Ejemplo n.º 10
0
        public void When_Hot_FootWear_Should_Be_Sandals()
        {
            var dressPicker = new DressPicker(Temperature.Hot.ToString());

            dressPicker.Process((int)Command.TakeOffPajama);
            dressPicker.Process((int)Command.PutOnPants);

            Assert.AreEqual(Outfit.Sandals.ToDescription(), dressPicker.Process((int)Command.PutOnFootWear));
        }
Ejemplo n.º 11
0
        public void Only_One_Peice_Of_FootWare_Can_Put_On()
        {
            var dressPicker = new DressPicker(Temperature.Hot.ToString());

            dressPicker.Process((int)Command.TakeOffPajama);
            dressPicker.Process((int)Command.PutOnPants);
            dressPicker.Process((int)Command.PutOnFootWear);
            Assert.Throws <OnlyOnePieceOfEachClothingAllowedViolation>(() => dressPicker.Process((int)Command.PutOnFootWear));
        }
Ejemplo n.º 12
0
        public void When_Hot_Jacket_Can_Not_Be_Put_On()
        {
            var dressPicker = new DressPicker(Temperature.Hot.ToString());

            dressPicker.Process((int)Command.TakeOffPajama);
            dressPicker.Process((int)Command.PutOnShirt);

            Assert.Throws <CannotPutJacketOnWhenHotViolation>(() => dressPicker.Process((int)Command.PutOnJacket));
        }
Ejemplo n.º 13
0
        public void When_Cold_Hat_Can_Be_Put_On()
        {
            var dressPicker = new DressPicker(Temperature.Cold.ToString());

            dressPicker.Process((int)Command.TakeOffPajama);
            dressPicker.Process((int)Command.PutOnShirt);

            Assert.AreEqual(Outfit.Hat.ToDescription(), dressPicker.Process((int)Command.PutOnHeadWear));
        }
Ejemplo n.º 14
0
        public void When_Cold_FootWear_Should_Be_Boots()
        {
            var dressPicker = new DressPicker(Temperature.Cold.ToString());

            dressPicker.Process((int)Command.TakeOffPajama);
            dressPicker.Process((int)Command.PutOnSocks);
            dressPicker.Process((int)Command.PutOnPants);
            var footWear = dressPicker.Process((int)Command.PutOnFootWear);

            Assert.AreEqual(Outfit.Boots.ToDescription(), footWear);
        }
Ejemplo n.º 15
0
        public void Pants_Must_Be_Put_On_Before_FootWear(Temperature temperature)
        {
            var dressPicker = new DressPicker(temperature.ToString());

            dressPicker.Process((int)Command.TakeOffPajama);
            if (temperature == Temperature.Cold)
            {
                dressPicker.Process((int)Command.PutOnSocks);
            }

            Assert.Throws <PantsMustBePutOnBeforeShoesViolation>(() => dressPicker.Process((int)Command.PutOnFootWear));
        }
Ejemplo n.º 16
0
        public void When_Hot_Socks_Is_Not_Manditory_To_Leave_House()
        {
            var dressPicker = new DressPicker(Temperature.Hot.ToString());

            dressPicker.Process((int)Command.TakeOffPajama);
            dressPicker.Process((int)Command.PutOnPants);
            dressPicker.Process((int)Command.PutOnFootWear);
            dressPicker.Process((int)Command.PutOnShirt);
            dressPicker.Process((int)Command.PutOnHeadWear);

            Assert.AreEqual("leaving house", dressPicker.Process((int)Command.LeaveHouse));
        }
Ejemplo n.º 17
0
        public void When_Hot_Headwear_Is_Manditory_To_Leave_House()
        {
            var dressPicker = new DressPicker(Temperature.Hot.ToString());

            dressPicker.Process((int)Command.TakeOffPajama);
            dressPicker.Process((int)Command.PutOnPants);
            dressPicker.Process((int)Command.PutOnFootWear);
            dressPicker.Process((int)Command.PutOnShirt);

            Assert.Throws <NotValidToLeaveHouseViolation>(() => dressPicker.Process((int)Command.LeaveHouse));
            dressPicker.Process((int)Command.PutOnHeadWear);

            Assert.AreEqual("leaving house", dressPicker.Process((int)Command.LeaveHouse));
        }
Ejemplo n.º 18
0
        public void Can_Remove_Pajama(Temperature temperature)
        {
            var dressPicker = new DressPicker(temperature.ToString());

            Assert.AreEqual("Removing PJs", dressPicker.Process((int)Command.TakeOffPajama));
        }
Ejemplo n.º 19
0
        public void Cannot_Leave_House_With_Pajama(Temperature temperature)
        {
            var dressPicker = new DressPicker(temperature.ToString());

            Assert.Throws <NotValidToLeaveHouseViolation>(() => dressPicker.Process((int)Command.LeaveHouse));
        }
Ejemplo n.º 20
0
        public void Should_Not_Accept_Invalid_Commands()
        {
            var dressPicker = new DressPicker(Temperature.Hot.ToString());

            Assert.Throws <NotValidCommandException>(() => dressPicker.Process(11));
        }
Ejemplo n.º 21
0
        public void Pajama_Must_Taken_Off_Before_Socks_Put_On(Temperature temperature)
        {
            var dressPicker = new DressPicker(temperature.ToString());

            Assert.Throws <PajamaMustTakeOffViolation>(() => dressPicker.Process((int)Command.PutOnSocks));
        }