private async Task <ApiSalesReasonResponseModel> CreateRecord() { var model = new ApiSalesReasonRequestModel(); model.SetProperties(DateTime.Parse("1/1/1988 12:00:00 AM"), "B", "B"); CreateResponse <ApiSalesReasonResponseModel> result = await this.Client.SalesReasonCreateAsync(model); result.Success.Should().BeTrue(); return(result.Record); }
public void MapModelToBO() { var mapper = new BOLSalesReasonMapper(); ApiSalesReasonRequestModel model = new ApiSalesReasonRequestModel(); model.SetProperties(DateTime.Parse("1/1/1987 12:00:00 AM"), "A", "A"); BOSalesReason response = mapper.MapModelToBO(1, model); response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.Name.Should().Be("A"); response.ReasonType.Should().Be("A"); }
public void MapRequestToResponse() { var mapper = new ApiSalesReasonModelMapper(); var model = new ApiSalesReasonRequestModel(); model.SetProperties(DateTime.Parse("1/1/1987 12:00:00 AM"), "A", "A"); ApiSalesReasonResponseModel response = mapper.MapRequestToResponse(1, model); response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.Name.Should().Be("A"); response.ReasonType.Should().Be("A"); response.SalesReasonID.Should().Be(1); }
public void CreatePatch() { var mapper = new ApiSalesReasonModelMapper(); var model = new ApiSalesReasonRequestModel(); model.SetProperties(DateTime.Parse("1/1/1987 12:00:00 AM"), "A", "A"); JsonPatchDocument <ApiSalesReasonRequestModel> patch = mapper.CreatePatch(model); var response = new ApiSalesReasonRequestModel(); patch.ApplyTo(response); response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.Name.Should().Be("A"); response.ReasonType.Should().Be("A"); }