public void MapResponseToRequest()
        {
            var mapper = new ApiAirTransportModelMapper();
            var model  = new ApiAirTransportResponseModel();

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

            response.FlightNumber.Should().Be("A");
            response.HandlerId.Should().Be(1);
            response.Id.Should().Be(1);
            response.LandDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.PipelineStepId.Should().Be(1);
            response.TakeoffDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
        }
        public async void TestUpdate()
        {
            var model = await this.CreateRecord();

            ApiAirTransportModelMapper mapper = new ApiAirTransportModelMapper();

            UpdateResponse <ApiAirTransportResponseModel> updateResponse = await this.Client.AirTransportUpdateAsync(model.AirlineId, mapper.MapResponseToRequest(model));

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

            await this.Cleanup();
        }
Example #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());

            ApiAirTransportResponseModel model = await client.AirTransportGetAsync(1);

            ApiAirTransportModelMapper mapper = new ApiAirTransportModelMapper();

            UpdateResponse <ApiAirTransportResponseModel> updateResponse = await client.AirTransportUpdateAsync(model.AirlineId, mapper.MapResponseToRequest(model));

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