Пример #1
0
        public void MapBOToModelList()
        {
            var            mapper = new BOLSpecialOfferMapper();
            BOSpecialOffer bo     = new BOSpecialOffer();

            bo.SetProperties(1, "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"), DateTime.Parse("1/1/1987 12:00:00 AM"), "A");
            List <ApiSpecialOfferResponseModel> response = mapper.MapBOToModel(new List <BOSpecialOffer>()
            {
                { bo }
            });

            response.Count.Should().Be(1);
        }
Пример #2
0
        public void MapModelToBO()
        {
            var mapper = new BOLSpecialOfferMapper();
            ApiSpecialOfferRequestModel model = new ApiSpecialOfferRequestModel();

            model.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"), DateTime.Parse("1/1/1987 12:00:00 AM"), "A");
            BOSpecialOffer response = mapper.MapModelToBO(1, model);

            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.StartDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.Type.Should().Be("A");
        }
Пример #3
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");
        }