public void MapResponseToRequest() { var mapper = new ApiSalesTerritoryHistoryModelMapper(); var model = new ApiSalesTerritoryHistoryResponseModel(); model.SetProperties(1, DateTime.Parse("1/1/1987 12:00:00 AM"), DateTime.Parse("1/1/1987 12:00:00 AM"), Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"), DateTime.Parse("1/1/1987 12:00:00 AM"), 1); ApiSalesTerritoryHistoryRequestModel response = mapper.MapResponseToRequest(model); response.EndDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.Rowguid.Should().Be(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da")); response.StartDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.TerritoryID.Should().Be(1); }
public async void TestUpdate() { var model = await this.CreateRecord(); ApiSalesTerritoryHistoryModelMapper mapper = new ApiSalesTerritoryHistoryModelMapper(); UpdateResponse <ApiSalesTerritoryHistoryResponseModel> updateResponse = await this.Client.SalesTerritoryHistoryUpdateAsync(model.BusinessEntityID, 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()); ApiSalesTerritoryHistoryResponseModel model = await client.SalesTerritoryHistoryGetAsync(1); ApiSalesTerritoryHistoryModelMapper mapper = new ApiSalesTerritoryHistoryModelMapper(); UpdateResponse <ApiSalesTerritoryHistoryResponseModel> updateResponse = await client.SalesTerritoryHistoryUpdateAsync(model.BusinessEntityID, mapper.MapResponseToRequest(model)); updateResponse.Record.Should().NotBeNull(); updateResponse.Success.Should().BeTrue(); }