public void Home_Page_With_Custom_Action(string virtualUrl)
        {
            // Arrange
            var pathData = new PathData();
            var pageModel = new DummyModel();

            var repository = new Mock<IPageRepository>();
            var mapper = new Mock<IControllerMapper>();
            var container = new Mock<IContainer>();

            container.Setup(x => x.GetInstance<IPageRepository>()).Returns(repository.Object);
            repository.Setup(x => x.SingleOrDefault<IPageModel>(model => model.Parent == null)).Returns(pageModel);
            mapper.Setup(m => m.GetControllerName(typeof(ContentController))).Returns("Content");
            mapper.Setup(m => m.ControllerHasAction("Content", "myaction")).Returns(true);

            var resolver = new DashboardPathResolver(pathData, repository.Object, mapper.Object, container.Object);

            // Act
            var data = resolver.ResolvePath(virtualUrl);

            // Assert
            Assert.NotNull(data);
            Assert.AreEqual("myaction", data.Action);
            Assert.AreEqual("Content", data.Controller);
        }
        public void Home_Page_With_Default_Action(string path)
        {
            // Arrange
            var pathData = new PathData();
            var pageModel = new DummyModel();

            var repository = new Mock<IPageRepository>();
            var mapper = new Mock<IControllerMapper>();
            var container = new Mock<IContainer>();

            container.Setup(x => x.GetInstance<IPageRepository>()).Returns(repository.Object);
            repository.Setup(x => x.SingleOrDefault<IPageModel>(model => model.Parent == null)).Returns(pageModel);
            var resolver = new DashboardPathResolver(pathData,repository.Object,mapper.Object, container.Object);

            // Act
            var data = resolver.ResolvePath(path);

            // Assert
            Assert.NotNull(data);
            Assert.AreEqual("index", data.Action);
            Assert.AreEqual("Content",data.Controller);
        }
        public void Page_With_Custom_Action(string virtualUrl)
        {
            // Arrange
            var pathData = new PathData();
            var pageModel = new DummyModel();

            var repository = new Mock<IPageRepository>();
            var mapper = new Mock<IControllerMapper>();
            var container = new Mock<IContainer>();

            container.Setup(x => x.GetInstance<IPageRepository>()).Returns(repository.Object);
            repository.Setup(r => r.GetPageByUrl<IPageModel>("page")).Returns(pageModel);
            mapper.Setup(m => m.GetControllerName(typeof (DummyController))).Returns("DummyModel");

            var resolver = new DashboardPathResolver(pathData, repository.Object, mapper.Object, container.Object);

            // Act
            var data = resolver.ResolvePath(virtualUrl);

            // Assert
            Assert.NotNull(data);
            Assert.AreEqual("myaction", data.Action);
            Assert.AreEqual("Content", data.Controller);
        }