예제 #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 Contains_Save_Method()
      {
         IImageRepository repository = new TestImageRepository();

         TadmapImage image = new TadmapImage(new TestImageRepository(), new TestBinaryRepository());

         repository.Save(image);
      }
예제 #4
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());
      }
예제 #5
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);
 }
예제 #6
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());
      }
예제 #7
0
      public void OffensiveFilter()
      {
         IImageRepository repository = new TestImageRepository();

         Assert.AreEqual(8, repository.GetAllImages(new TestBinaryRepository()).IsNotOffensive().Count());
      }
예제 #8
0
      public void PublicFilter()
      {
         IImageRepository repository = new TestImageRepository();

         Assert.AreEqual(5, repository.GetAllImages(new TestBinaryRepository()).IsPublic().Count());
      }
예제 #9
0
      public void Contains_GetAll_Retunrs_10_Items()
      {
         IImageRepository repository = new TestImageRepository();

         Assert.AreEqual(10, repository.GetAllImages(new TestBinaryRepository()).Count());
      }
예제 #10
0
      public void Contains_GetAll_Function()
      {
         IImageRepository repository = new TestImageRepository();

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