public void MapResponseToRequest() { var mapper = new ApiOrganizationModelMapper(); var model = new ApiOrganizationResponseModel(); model.SetProperties(1, "A"); ApiOrganizationRequestModel response = mapper.MapResponseToRequest(model); response.Name.Should().Be("A"); }
public async void TestUpdate() { var model = await this.CreateRecord(); ApiOrganizationModelMapper mapper = new ApiOrganizationModelMapper(); UpdateResponse <ApiOrganizationResponseModel> updateResponse = await this.Client.OrganizationUpdateAsync(model.Id, mapper.MapResponseToRequest(model)); updateResponse.Record.Should().NotBeNull(); updateResponse.Success.Should().BeTrue(); await this.Cleanup(); }
public async void TestUpdate() { var builder = new WebHostBuilder() .UseEnvironment("Production") .UseStartup <TestStartup>(); TestServer testServer = new TestServer(builder); var client = new ApiClient(testServer.CreateClient()); ApiOrganizationResponseModel model = await client.OrganizationGetAsync(1); ApiOrganizationModelMapper mapper = new ApiOrganizationModelMapper(); UpdateResponse <ApiOrganizationResponseModel> updateResponse = await client.OrganizationUpdateAsync(model.Id, mapper.MapResponseToRequest(model)); updateResponse.Record.Should().NotBeNull(); updateResponse.Success.Should().BeTrue(); }