public void MapEFToBOList()
        {
            var          mapper = new DALProductPhotoMapper();
            ProductPhoto entity = new ProductPhoto();

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

            List <BOProductPhoto> response = mapper.MapEFToBO(new List <ProductPhoto>()
            {
                entity
            });

            response.Count.Should().Be(1);
        }
Exemple #2
0
        public virtual ProductPhoto MapBOToEF(
            BOProductPhoto bo)
        {
            ProductPhoto efProductPhoto = new ProductPhoto();

            efProductPhoto.SetProperties(
                bo.LargePhoto,
                bo.LargePhotoFileName,
                bo.ModifiedDate,
                bo.ProductPhotoID,
                bo.ThumbNailPhoto,
                bo.ThumbnailPhotoFileName);
            return(efProductPhoto);
        }
        public void MapEFToBO()
        {
            var          mapper = new DALProductPhotoMapper();
            ProductPhoto entity = new ProductPhoto();

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

            BOProductPhoto response = mapper.MapEFToBO(entity);

            response.LargePhoto.Should().BeEquivalentTo(BitConverter.GetBytes(1));
            response.LargePhotoFileName.Should().Be("A");
            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.ProductPhotoID.Should().Be(1);
            response.ThumbNailPhoto.Should().BeEquivalentTo(BitConverter.GetBytes(1));
            response.ThumbnailPhotoFileName.Should().Be("A");
        }