public void MapResponseToRequest()
        {
            var mapper = new ApiAirlineModelMapper();
            var model  = new ApiAirlineResponseModel();

            model.SetProperties(1, "A");
            ApiAirlineRequestModel response = mapper.MapResponseToRequest(model);

            response.Name.Should().Be("A");
        }
        public async void TestUpdate()
        {
            var builder = new WebHostBuilder()
                          .UseEnvironment("Production")
                          .UseStartup <TestStartup>();
            TestServer testServer = new TestServer(builder);

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

            ApiAirlineResponseModel model = await client.AirlineGetAsync(1);

            ApiAirlineModelMapper mapper = new ApiAirlineModelMapper();

            UpdateResponse <ApiAirlineResponseModel> updateResponse = await client.AirlineUpdateAsync(model.Id, mapper.MapResponseToRequest(model));

            updateResponse.Record.Should().NotBeNull();
            updateResponse.Success.Should().BeTrue();
        }
Beispiel #3
0
        public async void TestUpdate()
        {
            var model = await this.CreateRecord();

            ApiAirlineModelMapper mapper = new ApiAirlineModelMapper();

            UpdateResponse <ApiAirlineResponseModel> updateResponse = await this.Client.AirlineUpdateAsync(model.Id, mapper.MapResponseToRequest(model));

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

            await this.Cleanup();
        }