예제 #1
0
        public void MapEFToBOList()
        {
            var          mapper = new DALSpecialOfferMapper();
            SpecialOffer entity = new SpecialOffer();

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

            List <BOSpecialOffer> response = mapper.MapEFToBO(new List <SpecialOffer>()
            {
                entity
            });

            response.Count.Should().Be(1);
        }
예제 #2
0
        public void MapEFToBO()
        {
            var          mapper = new DALSpecialOfferMapper();
            SpecialOffer entity = new SpecialOffer();

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

            BOSpecialOffer response = mapper.MapEFToBO(entity);

            response.Category.Should().Be("A");
            response.Description.Should().Be("A");
            response.DiscountPct.Should().Be(1m);
            response.EndDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.MaxQty.Should().Be(1);
            response.MinQty.Should().Be(1);
            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.SpecialOfferID.Should().Be(1);
            response.StartDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.Type.Should().Be("A");
        }