예제 #1
0
        public void MapResponseToRequest()
        {
            var mapper = new ApiScrapReasonModelMapper();
            var model  = new ApiScrapReasonResponseModel();

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

            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.Name.Should().Be("A");
        }
예제 #2
0
        public async void TestUpdate()
        {
            var model = await this.CreateRecord();

            ApiScrapReasonModelMapper mapper = new ApiScrapReasonModelMapper();

            UpdateResponse <ApiScrapReasonResponseModel> updateResponse = await this.Client.ScrapReasonUpdateAsync(model.ScrapReasonID, mapper.MapResponseToRequest(model));

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

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

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

            ApiScrapReasonResponseModel model = await client.ScrapReasonGetAsync(1);

            ApiScrapReasonModelMapper mapper = new ApiScrapReasonModelMapper();

            UpdateResponse <ApiScrapReasonResponseModel> updateResponse = await client.ScrapReasonUpdateAsync(model.ScrapReasonID, mapper.MapResponseToRequest(model));

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