示例#1
0
 public void TestForms()
 {
     SiteController controller = new SiteController();
     PrepareController(controller, "site", "forms");
     controller.Forms();
     Assert.AreEqual(@"site\forms", controller.SelectedViewName);
 }
示例#2
0
 public void TestAbout()
 {
     SiteController controller = new SiteController();
     PrepareController(controller, "site", "about");
     controller.About();
     Assert.AreEqual(@"site\about", controller.SelectedViewName);
 }
示例#3
0
        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();
        }
示例#4
0
        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();
        }
示例#5
0
 public void TestReports()
 {
     SiteController controller = new SiteController();
     PrepareController(controller, "site", "reports");
     controller.Reports();
     Assert.AreEqual(@"site\reports", controller.SelectedViewName);
 }