public void MapBOToModelList() { var mapper = new BOLProductPhotoMapper(); BOProductPhoto bo = new BOProductPhoto(); bo.SetProperties(1, BitConverter.GetBytes(1), "A", DateTime.Parse("1/1/1987 12:00:00 AM"), BitConverter.GetBytes(1), "A"); List <ApiProductPhotoResponseModel> response = mapper.MapBOToModel(new List <BOProductPhoto>() { { bo } }); response.Count.Should().Be(1); }
public void MapModelToBO() { var mapper = new BOLProductPhotoMapper(); ApiProductPhotoRequestModel model = new ApiProductPhotoRequestModel(); model.SetProperties(BitConverter.GetBytes(1), "A", DateTime.Parse("1/1/1987 12:00:00 AM"), BitConverter.GetBytes(1), "A"); BOProductPhoto response = mapper.MapModelToBO(1, model); 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.ThumbNailPhoto.Should().BeEquivalentTo(BitConverter.GetBytes(1)); response.ThumbnailPhotoFileName.Should().Be("A"); }
public void MapBOToModel() { var mapper = new BOLProductPhotoMapper(); BOProductPhoto bo = new BOProductPhoto(); bo.SetProperties(1, BitConverter.GetBytes(1), "A", DateTime.Parse("1/1/1987 12:00:00 AM"), BitConverter.GetBytes(1), "A"); ApiProductPhotoResponseModel response = mapper.MapBOToModel(bo); 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"); }
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"); }