public void WillReturn404IfTheCuratedFeedDoesNotExist() { var controller = new TestableCuratedPackagesController(); var result = controller.GetCreateCuratedPackageForm("aWrongFeedName"); Assert.IsType <HttpNotFoundResult>(result); }
public void WillReturn404IfTheCuratedFeedDoesNotExist() { var controller = new TestableCuratedPackagesController(); controller.StubCuratedFeedByNameQry.Setup(stub => stub.Execute(It.IsAny <string>(), It.IsAny <bool>())).Returns((CuratedFeed)null); var result = controller.GetCreateCuratedPackageForm("aFeedName"); Assert.IsType <HttpNotFoundResult>(result); }
public void WillPushTheCuratedFeedNameIntoTheViewBag() { var controller = new TestableCuratedPackagesController(); controller.StubCuratedFeed.Name = "theCuratedFeedName"; var result = controller.GetCreateCuratedPackageForm("theCuratedFeedName") as ViewResult; Assert.NotNull(result); Assert.Equal("theCuratedFeedName", result.ViewBag.CuratedFeedName); }
public void WillReturn403IfTheCurrentUsersIsNotAManagerOfTheCuratedFeed() { var controller = new TestableCuratedPackagesController(); controller.StubIdentity.Setup(stub => stub.Name).Returns("notAManager"); var result = controller.GetCreateCuratedPackageForm("aFeedName") as HttpStatusCodeResult; Assert.NotNull(result); Assert.Equal(403, result.StatusCode); }
public void WillReturn403IfTheCurrentUsersIsNotAManagerOfTheCuratedFeed() { var controller = new TestableCuratedPackagesController(); controller.SetCurrentUser(controller.Fakes.Owner); var result = controller.GetCreateCuratedPackageForm("aFeedName") as HttpStatusCodeResult; Assert.NotNull(result); Assert.Equal(403, result.StatusCode); }
public void WillPushTheCuratedFeedNameIntoTheViewBag() { var controller = new TestableCuratedPackagesController(); controller.SetCurrentUser(controller.Fakes.User); controller.StubCuratedFeed.Name = "theCuratedFeedName"; var result = controller.GetCreateCuratedPackageForm("theCuratedFeedName") as ViewResult; Assert.NotNull(result); Assert.Equal("theCuratedFeedName", result.ViewBag.CuratedFeedName); }
public void WillReturn404IfTheCuratedFeedDoesNotExist() { var controller = new TestableCuratedPackagesController(); controller.SetCurrentUser(controller.Fakes.User); var result = controller.GetCreateCuratedPackageForm("aWrongFeedName"); Assert.IsType<HttpNotFoundResult>(result); }