Example #1
0
        public void MapModelToBO()
        {
            var mapper = new BOLProductProductPhotoMapper();
            ApiProductProductPhotoRequestModel model = new ApiProductProductPhotoRequestModel();

            model.SetProperties(DateTime.Parse("1/1/1987 12:00:00 AM"), true, 1);
            BOProductProductPhoto response = mapper.MapModelToBO(1, model);

            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.Primary.Should().Be(true);
            response.ProductPhotoID.Should().Be(1);
        }
Example #2
0
        public void MapBOToModelList()
        {
            var mapper = new BOLProductProductPhotoMapper();
            BOProductProductPhoto bo = new BOProductProductPhoto();

            bo.SetProperties(1, DateTime.Parse("1/1/1987 12:00:00 AM"), true, 1);
            List <ApiProductProductPhotoResponseModel> response = mapper.MapBOToModel(new List <BOProductProductPhoto>()
            {
                { bo }
            });

            response.Count.Should().Be(1);
        }
Example #3
0
        public void MapBOToModel()
        {
            var mapper = new BOLProductProductPhotoMapper();
            BOProductProductPhoto bo = new BOProductProductPhoto();

            bo.SetProperties(1, DateTime.Parse("1/1/1987 12:00:00 AM"), true, 1);
            ApiProductProductPhotoResponseModel response = mapper.MapBOToModel(bo);

            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.Primary.Should().Be(true);
            response.ProductID.Should().Be(1);
            response.ProductPhotoID.Should().Be(1);
        }
        public void MapEFToBO()
        {
            var mapper = new DALProductProductPhotoMapper();
            ProductProductPhoto entity = new ProductProductPhoto();

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

            BOProductProductPhoto response = mapper.MapEFToBO(entity);

            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.Primary.Should().Be(true);
            response.ProductID.Should().Be(1);
            response.ProductPhotoID.Should().Be(1);
        }