예제 #1
0
        public void MapResponseToRequest()
        {
            var mapper = new ApiTableModelMapper();
            var model  = new ApiTableResponseModel();

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

            response.Name.Should().Be("A");
        }
예제 #2
0
        public async void TestUpdate()
        {
            var model = await this.CreateRecord();

            ApiTableModelMapper mapper = new ApiTableModelMapper();

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

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

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

            ApiTableResponseModel model = await client.TableGetAsync(1);

            ApiTableModelMapper mapper = new ApiTableModelMapper();

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

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