public async void TestUpdate()
        {
            var model = await this.CreateRecord();

            ApiWorkOrderModelMapper mapper = new ApiWorkOrderModelMapper();

            UpdateResponse <ApiWorkOrderResponseModel> updateResponse = await this.Client.WorkOrderUpdateAsync(model.WorkOrderID, mapper.MapResponseToRequest(model));

            updateResponse.Record.Should().NotBeNull();
            updateResponse.Success.Should().BeTrue();

            await this.Cleanup();
        }
        public async void TestUpdate()
        {
            var builder = new WebHostBuilder()
                          .UseEnvironment("Production")
                          .UseStartup <TestStartup>();
            TestServer testServer = new TestServer(builder);

            var client = new ApiClient(testServer.CreateClient());

            ApiWorkOrderResponseModel model = await client.WorkOrderGetAsync(1);

            ApiWorkOrderModelMapper mapper = new ApiWorkOrderModelMapper();

            UpdateResponse <ApiWorkOrderResponseModel> updateResponse = await client.WorkOrderUpdateAsync(model.WorkOrderID, mapper.MapResponseToRequest(model));

            updateResponse.Record.Should().NotBeNull();
            updateResponse.Success.Should().BeTrue();
        }
        public void MapResponseToRequest()
        {
            var mapper = new ApiWorkOrderModelMapper();
            var model  = new ApiWorkOrderResponseModel();

            model.SetProperties(1, DateTime.Parse("1/1/1987 12:00:00 AM"), DateTime.Parse("1/1/1987 12:00:00 AM"), DateTime.Parse("1/1/1987 12:00:00 AM"), 1, 1, 1, 1, DateTime.Parse("1/1/1987 12:00:00 AM"), 1);
            ApiWorkOrderRequestModel response = mapper.MapResponseToRequest(model);

            response.DueDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.EndDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.OrderQty.Should().Be(1);
            response.ProductID.Should().Be(1);
            response.ScrappedQty.Should().Be(1);
            response.ScrapReasonID.Should().Be(1);
            response.StartDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.StockedQty.Should().Be(1);
        }
        public void CreatePatch()
        {
            var mapper = new ApiWorkOrderModelMapper();
            var model  = new ApiWorkOrderRequestModel();

            model.SetProperties(DateTime.Parse("1/1/1987 12:00:00 AM"), DateTime.Parse("1/1/1987 12:00:00 AM"), DateTime.Parse("1/1/1987 12:00:00 AM"), 1, 1, 1, 1, DateTime.Parse("1/1/1987 12:00:00 AM"), 1);

            JsonPatchDocument <ApiWorkOrderRequestModel> patch = mapper.CreatePatch(model);
            var response = new ApiWorkOrderRequestModel();

            patch.ApplyTo(response);
            response.DueDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.EndDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.OrderQty.Should().Be(1);
            response.ProductID.Should().Be(1);
            response.ScrappedQty.Should().Be(1);
            response.ScrapReasonID.Should().Be(1);
            response.StartDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.StockedQty.Should().Be(1);
        }