public void WhenDeleteCalledForNonexistentPhoto_ThenThrows() { DatabaseTestUtility.DropCreateMileageStatsDatabase(); var repository = new VehiclePhotoRepository(new MileageStatsDbContext()); Assert.Throws <InvalidOperationException>(() => repository.Delete(12345)); }
public void WhenDeleteCalled_ThenPhotoNuked() { const int vehicleId = 1; var repository = new VehiclePhotoRepository(); var photo = new VehiclePhoto { ImageMimeType = "image/jpeg", Image = new byte[1] }; repository.Create(vehicleId, photo); repository.Delete(photo.Id); var repository2 = new VehiclePhotoRepository(); Assert.Null(repository2.Get(photo.Id)); }
public void WhenDeleteCalled_ThenPhotoNuked() { DatabaseTestUtility.DropCreateMileageStatsDatabase(); var repository = new VehiclePhotoRepository(new MileageStatsDbContext()); var photo = new Model.VehiclePhoto() { ImageMimeType = "image/jpeg", Image = new byte[1] }; repository.Create(1, photo); var photoToEdit = repository.Get(1); repository.Delete(photoToEdit.VehiclePhotoId); var repository2 = new VehiclePhotoRepository(new MileageStatsDbContext()); Assert.Throws <InvalidOperationException>(() => repository2.Get(1)); }
public void WhenDeleteCalledForNonexistentPhoto_ThenThrows() { var repository = new VehiclePhotoRepository(); Assert.Throws <InvalidOperationException>(() => repository.Delete(12345)); }
public void WhenDeleteCalledForNonexistentPhoto_ThenThrows() { var repository = new VehiclePhotoRepository(); Assert.Throws<InvalidOperationException>(() => repository.Delete(12345)); }