public void Contains_GetAll_Returns_5_Public_Items() { IImageRepository repository = new TestImageRepository(); int count = 0; foreach (TadmapImage image in repository.GetAllImages(new TestBinaryRepository())) if (image.IsPublic) count++; Assert.AreEqual(5, count); }
public void Administrator_Can_Mark_As_Offensive() { IImageRepository imageRepository = new TestImageRepository(); Guid id = new Guid("16b4d816-2e1e-4d54-9b66-78ef0fb7cbf1"); TadmapImage image = image = imageRepository.GetAllImages(new TestBinaryRepository()).WithId(id).SingleOrDefault(); Assert.IsFalse(image.IsOffensive); image.IsOffensive = true; imageRepository.Save(image); Assert.AreEqual(7, imageRepository.GetAllImages(new TestBinaryRepository()).IsNotOffensive().Count()); }
public void Contains_Save_Method() { IImageRepository repository = new TestImageRepository(); TadmapImage image = new TadmapImage(new TestImageRepository(), new TestBinaryRepository()); repository.Save(image); }
public void With_Non_Existant_Id_Returns_No_Image() { IImageRepository repository = new TestImageRepository(); Assert.AreEqual(0, repository.GetAllImages(new TestBinaryRepository()).WithId(Guid.NewGuid()).Count()); }
public void With_Known_Id_Returns_1_Image_With_Correct_OwnerName() { IImageRepository repository = new TestImageRepository(); TadmapImage image = repository.GetAllImages(new TestBinaryRepository()).WithId(new Guid("16b4d816-2e1e-4d54-9b66-78ef0fb7cbf1")).SingleOrDefault(); Assert.AreEqual("the owner", image.OwnerName); }
public void With_Known_Id_Returns_1_Image() { IImageRepository repository = new TestImageRepository(); Assert.AreEqual(1, repository.GetAllImages(new TestBinaryRepository()).WithId(new Guid("16b4d816-2e1e-4d54-9b66-78ef0fb7cbf1")).Count()); }
public void OffensiveFilter() { IImageRepository repository = new TestImageRepository(); Assert.AreEqual(8, repository.GetAllImages(new TestBinaryRepository()).IsNotOffensive().Count()); }
public void PublicFilter() { IImageRepository repository = new TestImageRepository(); Assert.AreEqual(5, repository.GetAllImages(new TestBinaryRepository()).IsPublic().Count()); }
public void Contains_GetAll_Retunrs_10_Items() { IImageRepository repository = new TestImageRepository(); Assert.AreEqual(10, repository.GetAllImages(new TestBinaryRepository()).Count()); }
public void Contains_GetAll_Function() { IImageRepository repository = new TestImageRepository(); Assert.IsNotNull(repository.GetAllImages(new TestBinaryRepository())); }