Exemple #1
0
        private async Task <ApiProductCostHistoryResponseModel> CreateRecord(ApiClient client)
        {
            var model = new ApiProductCostHistoryRequestModel();

            model.SetProperties(DateTime.Parse("1/1/1988 12:00:00 AM"), DateTime.Parse("1/1/1988 12:00:00 AM"), 2m, DateTime.Parse("1/1/1988 12:00:00 AM"));
            CreateResponse <ApiProductCostHistoryResponseModel> result = await client.ProductCostHistoryCreateAsync(model);

            result.Success.Should().BeTrue();
            return(result.Record);
        }
        public void MapModelToBO()
        {
            var mapper = new BOLProductCostHistoryMapper();
            ApiProductCostHistoryRequestModel model = new ApiProductCostHistoryRequestModel();

            model.SetProperties(DateTime.Parse("1/1/1987 12:00:00 AM"), DateTime.Parse("1/1/1987 12:00:00 AM"), 1m, DateTime.Parse("1/1/1987 12:00:00 AM"));
            BOProductCostHistory response = mapper.MapModelToBO(1, 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.StandardCost.Should().Be(1m);
            response.StartDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
        }
Exemple #3
0
        public void CreatePatch()
        {
            var mapper = new ApiProductCostHistoryModelMapper();
            var model  = new ApiProductCostHistoryRequestModel();

            model.SetProperties(DateTime.Parse("1/1/1987 12:00:00 AM"), DateTime.Parse("1/1/1987 12:00:00 AM"), 1m, DateTime.Parse("1/1/1987 12:00:00 AM"));

            JsonPatchDocument <ApiProductCostHistoryRequestModel> patch = mapper.CreatePatch(model);
            var response = new ApiProductCostHistoryRequestModel();

            patch.ApplyTo(response);
            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.StandardCost.Should().Be(1m);
            response.StartDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
        }