Esempio n. 1
0
        public void SavesAndFindsPhoto()
        {
            IPhoto photo = new PublicPhotoReference(TemporaryPhoto.Create("Original.jpg".GetPhoto()));

            using (var uow = UnitOfWork.Begin())
            {
                Repositories.Photos.Save(photo);
                uow.Persist();
            }
            UnitOfWork.Dispose();
            using (var uow = UnitOfWork.Begin())
            {
                IPhoto found = Repositories.Photos.FindById(photo.StaticId);
                Assert.IsNotNull(found);
                Assert.IsTrue("Original.jpg".GetPhoto().CompareByContent(found.Get()));
                Repositories.Photos.Remove(found);
                uow.Persist();
            }
        }