public void Delete_ShouldThrowExceptionWhenPhotoDoesNotExists()
        {
            var user  = UserCreator.Create("test");
            var photo = PhotoCreator.Create(user, false, false);

            var list            = new List <Photo>();
            var photosRepo      = DeletableEntityRepositoryMock.Get <Photo>(list);
            var photoAlbumsRepo = EfRepositoryMock.Get <PhotoAlbum>(new List <PhotoAlbum>());
            var storageService  = PhotoStorageServiceMock.Get();
            var metadataService = PhotoMetadataServiceMock.Get();

            var       service = new PhotoService(photosRepo.Object, storageService.Object, metadataService.Object, photoAlbumsRepo.Object);
            Exception ex      = Assert.Throws <AggregateException>(() => service.DeletePhotoAsync(photo.Id, user.Id).Wait());

            Assert.Contains("Such photo does not exists", ex.Message);
        }
        public void Delete_ShouldDeletePhotoSuccessfully()
        {
            var user  = UserCreator.Create("test");
            var photo = PhotoCreator.Create(user, false, false);

            var list = new List <Photo>()
            {
                photo
            };
            var photosRepo      = DeletableEntityRepositoryMock.Get <Photo>(list);
            var photoAlbumsRepo = EfRepositoryMock.Get <PhotoAlbum>(new List <PhotoAlbum>());
            var storageService  = PhotoStorageServiceMock.Get();
            var metadataService = PhotoMetadataServiceMock.Get();

            var service = new PhotoService(photosRepo.Object, storageService.Object, metadataService.Object, photoAlbumsRepo.Object);

            service.DeletePhotoAsync(photo.Id, user.Id).Wait();

            Assert.Empty(list);
        }