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