Ejemplo n.º 1
0
        public void MapResponseToRequest()
        {
            var mapper = new ApiDestinationModelMapper();
            var model  = new ApiDestinationResponseModel();

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

            response.CountryId.Should().Be(1);
            response.Name.Should().Be("A");
            response.Order.Should().Be(1);
        }
Ejemplo n.º 2
0
        public async void TestUpdate()
        {
            var builder = new WebHostBuilder()
                          .UseEnvironment("Production")
                          .UseStartup <TestStartup>();
            TestServer testServer = new TestServer(builder);

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

            ApiDestinationResponseModel model = await client.DestinationGetAsync(1);

            ApiDestinationModelMapper mapper = new ApiDestinationModelMapper();

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

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

            ApiDestinationModelMapper mapper = new ApiDestinationModelMapper();

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

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

            await this.Cleanup();
        }