Esempio n. 1
0
        public virtual ApiSalesTaxRateResponseModel MapBOToModel(
            BOSalesTaxRate boSalesTaxRate)
        {
            var model = new ApiSalesTaxRateResponseModel();

            model.SetProperties(boSalesTaxRate.SalesTaxRateID, boSalesTaxRate.ModifiedDate, boSalesTaxRate.Name, boSalesTaxRate.Rowguid, boSalesTaxRate.StateProvinceID, boSalesTaxRate.TaxRate, boSalesTaxRate.TaxType);

            return(model);
        }
        public void MapResponseToRequest()
        {
            var mapper = new ApiSalesTaxRateModelMapper();
            var model  = new ApiSalesTaxRateResponseModel();

            model.SetProperties(1, DateTime.Parse("1/1/1987 12:00:00 AM"), "A", Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"), 1, 1m, 1);
            ApiSalesTaxRateRequestModel response = mapper.MapResponseToRequest(model);

            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.Name.Should().Be("A");
            response.Rowguid.Should().Be(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"));
            response.StateProvinceID.Should().Be(1);
            response.TaxRate.Should().Be(1m);
            response.TaxType.Should().Be(1);
        }