public void Test_CreateStandardUrl() { string applicationPath = "/Test"; string originalUrl = "http://localhost/Test"; string action = "MockAction"; string typeName = "MockType"; UrlCreator creator = new UrlCreator(applicationPath, originalUrl); string url = creator.CreateStandardUrl(action, typeName); string expectedUrl = "/Test/Projector.aspx?a=" + creator.PrepareForUrl(action) + "&t=" + creator.PrepareForUrl(typeName) + "&f=Html"; Assert.AreEqual(expectedUrl, url, "The URL doesn't match what's expected."); }
public void Test_CreateStandardUrl_MatchProperty() { InitializeMockProjections(); string applicationPath = "/Test"; string originalUrl = "http://localhost/Test"; string action = "Create"; string typeName = "User"; UrlCreator creator = new UrlCreator(applicationPath, originalUrl); string propertyName = "ID"; string dataKey = Guid.NewGuid().ToString(); string url = creator.CreateStandardUrl(action, typeName, propertyName, dataKey); string expectedUrl = "/Test/Projector.aspx?a=" + creator.PrepareForUrl(action) + "&t=" + creator.PrepareForUrl(typeName) + "&f=Html&" + typeName + "-" + propertyName + "=" + creator.PrepareForUrl(dataKey); Assert.AreEqual(expectedUrl, url, "The URL doesn't match what's expected."); }
public string GetStandardLink(string action, string type) { return(UrlCreator.CreateStandardUrl(action, type)); }