public void ShouldWorkForSingleLetterAppVirtualDir() { var tokenizer = new DefaultUrlTokenizer(); var urlinfo = tokenizer.TokenizeUrl("/v/area/controller/action.castle", null, new Uri("http://www.castleproject.org/v/area/controller/action.castle"), true, "/v"); var parameters = new UrlBuilderParameters(); Assert.AreEqual("/v/area/controller/action.castle", urlBuilder.BuildUrl(urlinfo, parameters)); }
public void UseAbsPathWithWWW() { var tokenizer = new DefaultUrlTokenizer(); var urlinfo = tokenizer.TokenizeUrl("/area/home/index.castle", null, new Uri("http://www.castleproject.org"), true, string.Empty); var parameters = new UrlBuilderParameters("test", "action") { CreateAbsolutePath = true }; Assert.AreEqual("http://www.castleproject.org/area/test/action.castle", urlBuilder.BuildUrl(urlinfo, parameters)); }
public void AddingSimpleDefault() { tokenizer.AddDefaultRule("index.rails", "", "client", "list"); var info = tokenizer.TokenizeUrl("/index.rails", null, new Uri("http://localhost"), true, null); Assert.IsNotNull(info); Assert.AreEqual("client", info.Controller); Assert.AreEqual("list", info.Action); Assert.AreEqual(String.Empty, info.Area); Assert.AreEqual("rails", info.Extension); }