コード例 #1
0
        public virtual ApiProductVendorResponseModel MapBOToModel(
            BOProductVendor boProductVendor)
        {
            var model = new ApiProductVendorResponseModel();

            model.SetProperties(boProductVendor.ProductID, boProductVendor.AverageLeadTime, boProductVendor.BusinessEntityID, boProductVendor.LastReceiptCost, boProductVendor.LastReceiptDate, boProductVendor.MaxOrderQty, boProductVendor.MinOrderQty, boProductVendor.ModifiedDate, boProductVendor.OnOrderQty, boProductVendor.StandardPrice, boProductVendor.UnitMeasureCode);

            return(model);
        }
コード例 #2
0
        public void MapResponseToRequest()
        {
            var mapper = new ApiProductVendorModelMapper();
            var model  = new ApiProductVendorResponseModel();

            model.SetProperties(1, 1, 1, 1m, DateTime.Parse("1/1/1987 12:00:00 AM"), 1, 1, DateTime.Parse("1/1/1987 12:00:00 AM"), 1, 1m, "A");
            ApiProductVendorRequestModel response = mapper.MapResponseToRequest(model);

            response.AverageLeadTime.Should().Be(1);
            response.BusinessEntityID.Should().Be(1);
            response.LastReceiptCost.Should().Be(1m);
            response.LastReceiptDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.MaxOrderQty.Should().Be(1);
            response.MinOrderQty.Should().Be(1);
            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.OnOrderQty.Should().Be(1);
            response.StandardPrice.Should().Be(1m);
            response.UnitMeasureCode.Should().Be("A");
        }