public void Can_Resolve_Virtual_Path() { // Given var page = new FakePage { Metadata = { Url = "foo/bar/fudge" } }; var resolver = new VirtualPathResolver(); // When var result = resolver.Resolve(page, new RouteValueDictionary(new { action = "index" })); // Then Assert.Equal("foo/bar/fudge/", result); }
public void Can_Append_Action_To_Url() { // Given var page = new FakePage { Metadata = { Url = "foo/bar/fudge" } }; var resolver = new VirtualPathResolver(); // When var result = resolver.Resolve(page, new RouteValueDictionary(new { action = "comment" })); // Then Assert.Equal("foo/bar/fudge/comment/", result); }
public void Can_Resolve_Virtual_Path_With_Default_Action() { // Arrange IPage model = new FakePage { Metadata = { Url = "page1/page2" } }; var routeValueDictionary = new RouteValueDictionary(); // Act var virtualPathResolver = new VirtualPathResolver(); var virtualPath = virtualPathResolver.Resolve(model, routeValueDictionary); // Assert Assert.AreEqual("page1/page2/", virtualPath); }