public void MapResponseToRequest()
        {
            var mapper = new ApiUnitMeasureModelMapper();
            var model  = new ApiUnitMeasureResponseModel();

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

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

            ApiUnitMeasureModelMapper mapper = new ApiUnitMeasureModelMapper();

            UpdateResponse <ApiUnitMeasureResponseModel> updateResponse = await this.Client.UnitMeasureUpdateAsync(model.UnitMeasureCode, mapper.MapResponseToRequest(model));

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

            await this.Cleanup();
        }
Ejemplo n.º 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());

            ApiUnitMeasureResponseModel model = await client.UnitMeasureGetAsync("A");

            ApiUnitMeasureModelMapper mapper = new ApiUnitMeasureModelMapper();

            UpdateResponse <ApiUnitMeasureResponseModel> updateResponse = await client.UnitMeasureUpdateAsync(model.UnitMeasureCode, mapper.MapResponseToRequest(model));

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