public void MapResponseToRequest() { var mapper = new ApiBreedModelMapper(); var model = new ApiBreedResponseModel(); model.SetProperties(1, "A"); ApiBreedRequestModel response = mapper.MapResponseToRequest(model); response.Name.Should().Be("A"); }
public async void TestUpdate() { var model = await this.CreateRecord(); ApiBreedModelMapper mapper = new ApiBreedModelMapper(); UpdateResponse <ApiBreedResponseModel> updateResponse = await this.Client.BreedUpdateAsync(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()); ApiBreedResponseModel model = await client.BreedGetAsync(1); ApiBreedModelMapper mapper = new ApiBreedModelMapper(); UpdateResponse <ApiBreedResponseModel> updateResponse = await client.BreedUpdateAsync(model.Id, mapper.MapResponseToRequest(model)); updateResponse.Record.Should().NotBeNull(); updateResponse.Success.Should().BeTrue(); }