Example #1
0
        public async Task GetCreateOrderViewModelTestAsync()
        {
            // Arrange
            var humanResourcesBusinessObject = BusinessObjectMocker.GetHumanResourcesBusinessObject();
            var productionBusinessObject     = BusinessObjectMocker.GetProductionBusinessObject();
            var salesBusinessObject          = BusinessObjectMocker.GetSalesBusinessObject();

            using (var controller = new SalesController(null, humanResourcesBusinessObject, productionBusinessObject, salesBusinessObject))
            {
                // Act
                var response = await controller.GetCreateOrderViewModel() as ObjectResult;

                // Assert
                var value = response.Value as ISingleModelResponse <CreateOrderViewModel>;

                Assert.False(value.DidError);
            }
        }
        public async Task TestGetCreateOrderRequestAsync()
        {
            // Arrange
            var logger = LoggerMocker.GetLogger <SalesController>();
            var humanResourcesBusinessObject = BusinessObjectMocker.GetHumanResourcesBusinessObject();
            var productionBusinessObject     = BusinessObjectMocker.GetProductionBusinessObject();
            var salesBusinessObject          = BusinessObjectMocker.GetSalesBusinessObject();

            using (var controller = new SalesController(logger, humanResourcesBusinessObject, productionBusinessObject, salesBusinessObject))
            {
                // Act
                var response = await controller.GetCreateOrderRequestAsync() as ObjectResult;

                var value = response.Value as ISingleResponse <CreateOrderRequest>;

                // Assert
                Assert.False(value.DidError);
            }
        }
        public async Task GetOrdersTestAsync()
        {
            // Arrange
            var logger = LoggerMocker.GetLogger <SalesController>();
            var humanResourcesBusinessObject = BusinessObjectMocker.GetHumanResourcesBusinessObject();
            var productionBusinessObject     = BusinessObjectMocker.GetProductionBusinessObject();
            var salesBusinessObject          = BusinessObjectMocker.GetSalesBusinessObject();

            using (var controller = new SalesController(logger, humanResourcesBusinessObject, productionBusinessObject, salesBusinessObject))
            {
                // Act
                var response = await controller.GetOrders() as ObjectResult;

                // Assert
                var value = response.Value as IPagingModelResponse <OrderInfo>;

                Assert.False(value.DidError);
            }
        }