public void ShipApprovedOrder()
        {
            Order initialOrder = new Order();

            initialOrder.SetId(1);
            initialOrder.SetStatus(OrderStatus.Approved);
            orderRepository.AddOrder(initialOrder);

            OrderShipmentRequest request = new OrderShipmentRequest();

            request.SetOrderId(1);

            useCase.Run(request);

            orderRepository.GetSavedOrder().GetStatus().Should().Be(OrderStatus.Shipped);
            shipmentService.GetShippedOrder().Should().Be(initialOrder);
        }
Exemple #2
0
        public void shipApprovedOrder()
        {
            Order initialOrder = new Order();

            initialOrder.Id     = 1;
            initialOrder.Status = OrderStatus.Approved;
            orderRepository.AddOrder(initialOrder);

            OrderShipmentRequest request = new OrderShipmentRequest();

            request.OrderId = 1;

            useCase.Run(request);

            orderRepository.GetSavedOrder().Status.Should().Be(OrderStatus.Shipped);
            shipmentService.GetShippedOrder().Should().BeSameAs(initialOrder);
        }
Exemple #3
0
        public void ShipApprovedOrder()
        {
            var initialOrder = new Order
            {
                Status = OrderStatus.Approved,
                Id     = 1
            };

            _orderRepository.AddOrder(initialOrder);

            var request = new OrderShipmentRequest
            {
                OrderId = 1
            };

            _useCase.Run(request);

            Assert.Equal(OrderStatus.Shipped, _orderRepository.GetSavedOrder().Status);
            Assert.Same(initialOrder, _shipmentService.GetShippedOrder());
        }