public void Process_OrderIsAlreadyShipped_ThrowsAnException()
 {
     var orderProcessor = new OrderProcessor(new FakeShippingCalculator());
     var order          = new Order
     {
         Shipment = new Shipment()
     };
 }
示例#2
0
        public void Process_Mock_IsShipped_ThrowException()
        {
            var orderProcessor = new OrderProcessor(new MockShippingCalculator());

            orderProcessor.Process(new Order {
                IsShipped = true, Shipment = new Shipment()
            });
        }
        public void Process_OrderIsNotShipped_ShouldSetTheShipmentPropertyOfTheOrder()
        {
            var orderProcessor = new OrderProcessor(new FakeShippingCalculator());
            var order          = new Order();

            orderProcessor.Process(order);

            Assert.(order.IsShipped)
        }
示例#4
0
        public void Process_OrderIsNotShipped_ShouldSetTheShipmentPropertyOfTheOrder()
        {
            var orderProcessor = new OrderProcessor(new FakeShippingCalculator());
            var order          = new Order();

            orderProcessor.Process(order);
            Assert.IsTrue(order.IsShipped);
            Assert.AreEqual(1, order.Shipment.Cost);
            Assert.AreEqual(DateTime.Today.AddDays(1), order.Shipment.ShippingDate);
        }
示例#5
0
        public void Process_Mock_IsNotShipped_SetShipment()
        {
            var orderProcessor = new OrderProcessor(new MockShippingCalculator());
            var order          = new Order();

            orderProcessor.Process(order);
            Assert.IsTrue(order.IsShipped);
            Assert.AreEqual(100f, order.Shipment.Cost);
            Assert.AreEqual(DateTime.Today.AddDays(1), order.Shipment.ShippingDate);
        }
        public void Process_OrderAlreadyShipped_ThrowsException()
        {
            var orderProcessor = new OrderProcessor(new FakeShippingCalculator());
            // Create a shipped order, one with the Shipment property initialized
            var order = new Order {
                Shipment = new Shipment()
            };

            orderProcessor.Process(order);
        }
        public void Process_OrderIsAlreadyShipped_ThrowsAnException()
        {
            var orderProcessor = new OrderProcessor(new FakeOrderProcessor());
            var order          = new Order
            {
                Shipment = new Shipment()
            };

            orderProcessor.Process(order);
        }
        public void Process_OrderIsAlreadyShipped_ThrowsAnException()
        {
            var orderProcessor = new OrderProcessor(new FakeShippingCalculator());
            var order          = new Order
            {
                Shipment = new Shipment()
            };

            Assert.Throws <InvalidOperationException>(() => orderProcessor.Process(order));
            //orderProcessor.Process(order);
        }
        public void Process_OrderIsAlreadyShipped_ThrowsAnException()
        {
            // You will need to add a reference to the Testability project so that we can use classes outlined there.
            var orderProcessor = new OrderProcessor(new FakeShippingCalculator());
            // creating an order that is already shipped...
            var order = new Order
            {
                Shipment = new Shipment()
            };

            orderProcessor.Process(order);
        }
        public void Process_OrderNotShipped_SetTheShipmentProperty()
        {
            var orderProcessor = new OrderProcessor(new FakeShippingCalculator());
            var order          = new Order(); // Shipment property is not initialized

            orderProcessor.Process(order);

            // calling Process initializes the Shipment property
            // so we should assert that the order is now shipped
            Assert.IsTrue(order.isShipped);

            // Assert.AreEqual(Expected, Actual)

            // FakeShippingCalculator returns 1
            // so the shipment cost of the order should be equal to 1
            Assert.AreEqual(1, order.Shipment.Cost);
            // and the shipping date should be tomorrow
            Assert.AreEqual(DateTime.Now.AddDays(1).Day, order.Shipment.ShippingDate.Day);
        }
 public void Process_OrderIsAlreadyShipped_ThrowsAnExpection()
 {
     var orderProcessor = new OrderProcessor(new FakeShippingCalculator());
 }
示例#12
0
 public void Process_OrderIsAlreadyShipped_ThrowsAnException()
 {
     var orderProcessor = new OrderProcessor();
 }