public void TestForms() { SiteController controller = new SiteController(); PrepareController(controller, "site", "forms"); controller.Forms(); Assert.AreEqual(@"site\forms", controller.SelectedViewName); }
public void TestAbout() { SiteController controller = new SiteController(); PrepareController(controller, "site", "about"); controller.About(); Assert.AreEqual(@"site\about", controller.SelectedViewName); }
public void TestIndexAction() { AtlasMediator mediator = mocks.CreateMock<AtlasMediator>(); IList<InteractiveMap> interactiveMaps = mocks.CreateMock<IList<InteractiveMap>>(); Expect.Call(mediator.FindAllInteractiveMapsByTitles(null)).IgnoreArguments() .Return(interactiveMaps); mocks.ReplayAll(); SiteController controller = new SiteController(); controller.AtlasMediator = mediator; PrepareController(controller, "site", "index"); controller.Index(); Assert.AreEqual(interactiveMaps, controller.PropertyBag["interactive_maps"]); Assert.AreEqual(@"site\index", controller.SelectedViewName); mocks.VerifyAll(); }
public void TestMaps() { AtlasMediator mediator = mocks.CreateMock<AtlasMediator>(); IList<InteractiveMap> interactiveMaps = mocks.CreateMock<IList<InteractiveMap>>(); IList<PublishedMap> publishedMaps = mocks.CreateMock<IList<PublishedMap>>(); Expect.Call(mediator.FindAll<InteractiveMap>()).Return(interactiveMaps); Expect.Call(mediator.FindAllPublishedMaps()).Return(publishedMaps); mocks.ReplayAll(); SiteController controller = new SiteController(); controller.AtlasMediator = mediator; PrepareController(controller, "site", "maps"); controller.Maps(); Assert.AreEqual(interactiveMaps, controller.PropertyBag["interactive_maps"]); Assert.AreEqual(publishedMaps, controller.PropertyBag["published_maps"]); Assert.AreEqual(@"site\maps", controller.SelectedViewName); mocks.VerifyAll(); }
public void TestReports() { SiteController controller = new SiteController(); PrepareController(controller, "site", "reports"); controller.Reports(); Assert.AreEqual(@"site\reports", controller.SelectedViewName); }