Example #1
0
        public virtual SalesPersonQuotaHistory MapBOToEF(
            BOSalesPersonQuotaHistory bo)
        {
            SalesPersonQuotaHistory efSalesPersonQuotaHistory = new SalesPersonQuotaHistory();

            efSalesPersonQuotaHistory.SetProperties(
                bo.BusinessEntityID,
                bo.ModifiedDate,
                bo.QuotaDate,
                bo.Rowguid,
                bo.SalesQuota);
            return(efSalesPersonQuotaHistory);
        }
        public void MapEFToBOList()
        {
            var mapper = new DALSalesPersonQuotaHistoryMapper();
            SalesPersonQuotaHistory entity = new SalesPersonQuotaHistory();

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

            List <BOSalesPersonQuotaHistory> response = mapper.MapEFToBO(new List <SalesPersonQuotaHistory>()
            {
                entity
            });

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

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

            BOSalesPersonQuotaHistory response = mapper.MapEFToBO(entity);

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