public void Returns_ViewResult_For_Collector() { UploadController upload = new UploadController(); ActionResult result = upload.Index(Principals.Collector); Assert.IsInstanceOfType(typeof(ViewResult), result); }
public void Redirect_For_Guest_Is_TestURL() { UploadController upload = new UploadController(); RedirectResult result = upload.Index(Principals.Guest) as RedirectResult; Assert.AreEqual("/TestURL", result.Url); }
public void Does_Redirect_For_Guest() { UploadController upload = new UploadController(); ActionResult result = upload.Index(Principals.Guest); Assert.IsInstanceOfType(typeof(RedirectResult), result); }
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); }
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); }
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); }
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); }