Пример #1
0
      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);
      }
Пример #2
0
      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());
      }
Пример #3
0
      public void With_Non_Existant_Id_Returns_No_Image()
      {
         IImageRepository repository = new TestImageRepository();

         Assert.AreEqual(0, repository.GetAllImages(new TestBinaryRepository()).WithId(Guid.NewGuid()).Count());
      }
Пример #4
0
 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);
 }
Пример #5
0
      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());
      }
Пример #6
0
      public void OffensiveFilter()
      {
         IImageRepository repository = new TestImageRepository();

         Assert.AreEqual(8, repository.GetAllImages(new TestBinaryRepository()).IsNotOffensive().Count());
      }
Пример #7
0
      public void PublicFilter()
      {
         IImageRepository repository = new TestImageRepository();

         Assert.AreEqual(5, repository.GetAllImages(new TestBinaryRepository()).IsPublic().Count());
      }
Пример #8
0
      public void Contains_GetAll_Retunrs_10_Items()
      {
         IImageRepository repository = new TestImageRepository();

         Assert.AreEqual(10, repository.GetAllImages(new TestBinaryRepository()).Count());
      }
Пример #9
0
      public void Contains_GetAll_Function()
      {
         IImageRepository repository = new TestImageRepository();

         Assert.IsNotNull(repository.GetAllImages(new TestBinaryRepository()));
      }