Ejemplo n.º 1
0
      public void Returns_View_Result_With_No_Name_For_Administrator()
      {
         AdminController admin = new AdminController(new TestImageRepository());

         ViewResult result = (ViewResult)admin.Index(Principals.Administrator);

         Assert.AreEqual("", result.ViewName);
      }
Ejemplo n.º 2
0
      public void Model_Contains_10_Images()
      {
         AdminController admin = new AdminController(new TestImageRepository());

         ViewResult result = (ViewResult)admin.Index(Principals.Administrator);

         Assert.IsNotNull(result.ViewData);
         Assert.IsNotNull(result.ViewData.Model);
         Assert.IsInstanceOfType(typeof(List<TadmapImage>), result.ViewData.Model);

         List<TadmapImage> images = result.ViewData.Model as List<TadmapImage>;

         Assert.AreEqual(10, images.Count);
      }