示例#1
0
        public void MapEFToBOList()
        {
            var         mapper = new DALSalesPersonMapper();
            SalesPerson entity = new SalesPerson();

            entity.SetProperties(1m, 1, 1m, DateTime.Parse("1/1/1987 12:00:00 AM"), Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"), 1m, 1m, 1m, 1);

            List <BOSalesPerson> response = mapper.MapEFToBO(new List <SalesPerson>()
            {
                entity
            });

            response.Count.Should().Be(1);
        }
        public virtual SalesPerson MapBOToEF(
            BOSalesPerson bo)
        {
            SalesPerson efSalesPerson = new SalesPerson();

            efSalesPerson.SetProperties(
                bo.Bonus,
                bo.BusinessEntityID,
                bo.CommissionPct,
                bo.ModifiedDate,
                bo.Rowguid,
                bo.SalesLastYear,
                bo.SalesQuota,
                bo.SalesYTD,
                bo.TerritoryID);
            return(efSalesPerson);
        }
示例#3
0
        public void MapEFToBO()
        {
            var         mapper = new DALSalesPersonMapper();
            SalesPerson entity = new SalesPerson();

            entity.SetProperties(1m, 1, 1m, DateTime.Parse("1/1/1987 12:00:00 AM"), Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"), 1m, 1m, 1m, 1);

            BOSalesPerson response = mapper.MapEFToBO(entity);

            response.Bonus.Should().Be(1m);
            response.BusinessEntityID.Should().Be(1);
            response.CommissionPct.Should().Be(1m);
            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.Rowguid.Should().Be(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"));
            response.SalesLastYear.Should().Be(1m);
            response.SalesQuota.Should().Be(1m);
            response.SalesYTD.Should().Be(1m);
            response.TerritoryID.Should().Be(1);
        }