コード例 #1
0
        public void The_soonest_delivery_date_is_two_days_from_now()
        {
            DeliveryService sut          = new DeliveryService();
            DateTime        deliveryDate = DateTime.Now.AddDays(2);
            Delivery        delivery     = new Delivery
            {
                Date = deliveryDate
            };

            bool isValid = sut.IsDeliveryValid(delivery);

            Assert.True(isValid);
        }
コード例 #2
0
        public void Detects_an_invalid_delivery_date2(int daysFromNow)
        {
            DeliveryService sut          = new DeliveryService();
            DateTime        deliveryDate = DateTime.Now.AddDays(daysFromNow);
            Delivery        delivery     = new Delivery
            {
                Date = deliveryDate
            };

            bool isValid = sut.IsDeliveryValid(delivery);

            Assert.False(isValid);
        }
コード例 #3
0
        public void Detects_an_invalid_delivery_date3(
            DateTime deliveryDate,
            bool expected)
        {
            DeliveryService sut      = new DeliveryService();
            Delivery        delivery = new Delivery
            {
                Date = deliveryDate
            };

            bool isValid = sut.IsDeliveryValid(delivery);

            Assert.Equal(expected, isValid);
        }