Esempio n. 1
0
        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.");
        }
Esempio n. 2
0
        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 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.");
        }
Esempio n. 4
0
 public string GetStandardLink(string action, string type)
 {
     return(UrlCreator.CreateStandardUrl(action, type));
 }
        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.");
        }