示例#1
0
        public virtual ProductCostHistory MapBOToEF(
            BOProductCostHistory bo)
        {
            ProductCostHistory efProductCostHistory = new ProductCostHistory();

            efProductCostHistory.SetProperties(
                bo.EndDate,
                bo.ModifiedDate,
                bo.ProductID,
                bo.StandardCost,
                bo.StartDate);
            return(efProductCostHistory);
        }
        public void MapEFToBOList()
        {
            var mapper = new DALProductCostHistoryMapper();
            ProductCostHistory entity = new ProductCostHistory();

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

            List <BOProductCostHistory> response = mapper.MapEFToBO(new List <ProductCostHistory>()
            {
                entity
            });

            response.Count.Should().Be(1);
        }
        public void MapEFToBO()
        {
            var mapper = new DALProductCostHistoryMapper();
            ProductCostHistory entity = new ProductCostHistory();

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

            BOProductCostHistory response = mapper.MapEFToBO(entity);

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