Beispiel #1
0
      public void Returns_ViewResult_For_Collector()
      {
         UploadController upload = new UploadController();

         ActionResult result = upload.Index(Principals.Collector);

         Assert.IsInstanceOfType(typeof(ViewResult), result); 
      }
Beispiel #2
0
      public void Redirect_For_Guest_Is_TestURL()
      {
         UploadController upload = new UploadController();

         RedirectResult result = upload.Index(Principals.Guest) as RedirectResult;

         Assert.AreEqual("/TestURL", result.Url);
      }
Beispiel #3
0
      public void Does_Redirect_For_Guest()
      {
         UploadController upload = new UploadController();

         ActionResult result = upload.Index(Principals.Guest);

         Assert.IsInstanceOfType(typeof(RedirectResult), result);
      }
Beispiel #4
0
      public void Returns_Redirect_For_Collector()
      {
         UploadController upload = new UploadController();

         ActionResult result = upload.Upload("title", "description", Principals.Collector, new TestUploadedFile());

         Assert.IsInstanceOfType(typeof(RedirectToRouteResult), result);
      }
Beispiel #5
0
      public void Redirect_For_Guest_Is_TestURL()
      {
         UploadController upload = new UploadController();

         RedirectResult result = upload.Upload("title", "description", Principals.Guest, new TestUploadedFile()) as RedirectResult;

         Assert.AreEqual("/TestURL", result.Url);
      }
Beispiel #6
0
      public void Does_Redirect_For_Guest()
      {
         UploadController upload = new UploadController();

         ActionResult result = upload.Upload("title", "description", Principals.Guest, new TestUploadedFile());

         Assert.IsInstanceOfType(typeof(RedirectResult), result);
      }
Beispiel #7
0
      public void Returns_ViewResult_With_Empty_Name_And_Null_Model_With_No_Errors()
      {
         UploadController upload = new UploadController();

         ViewResult result = upload.Index(Principals.Collector) as ViewResult;

         Assert.IsEmpty(result.ViewName);
         Assert.IsNull(result.ViewData.Model);
         Assert.AreEqual(0, result.ViewData.ModelState.Count);
      }