Exemplo n.º 1
0
        public void MapResponseToRequest()
        {
            var mapper = new ApiProvinceModelMapper();
            var model  = new ApiProvinceResponseModel();

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

            response.CountryId.Should().Be(1);
            response.Name.Should().Be("A");
        }
Exemplo n.º 2
0
        public async void TestUpdate()
        {
            var model = await this.CreateRecord();

            ApiProvinceModelMapper mapper = new ApiProvinceModelMapper();

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

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

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

            ApiProvinceResponseModel model = await client.ProvinceGetAsync(1);

            ApiProvinceModelMapper mapper = new ApiProvinceModelMapper();

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

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