public void MapResponseToRequest() { var mapper = new ApiVoteTypeModelMapper(); var model = new ApiVoteTypeResponseModel(); model.SetProperties(1, "A"); ApiVoteTypeRequestModel response = mapper.MapResponseToRequest(model); response.Name.Should().Be("A"); }
public async void TestUpdate() { var builder = new WebHostBuilder() .UseEnvironment("Production") .UseStartup <TestStartup>(); TestServer testServer = new TestServer(builder); var client = new ApiClient(testServer.CreateClient()); ApiVoteTypeResponseModel model = await client.VoteTypeGetAsync(1); ApiVoteTypeModelMapper mapper = new ApiVoteTypeModelMapper(); UpdateResponse <ApiVoteTypeResponseModel> updateResponse = await client.VoteTypeUpdateAsync(model.Id, mapper.MapResponseToRequest(model)); updateResponse.Record.Should().NotBeNull(); updateResponse.Success.Should().BeTrue(); }