Example #1
0
        public void CombineUrls_NoValues()
        {
            // Call method
            string result = Path.CombineUrls();

            // Validate
            Assert.AreEqual(@"", result);
        }
Example #2
0
        public void CombineUrls_1Value()
        {
            // Declare variables
            string path1 = @"http://www.catenalogic.com";

            // Call method
            string result = Path.CombineUrls(path1);

            // Validate
            Assert.AreEqual(@"http://www.catenalogic.com", result);
        }
Example #3
0
        public void CombineUrls_2Values()
        {
            // Declare variables
            string path1 = @"http://www.catenalogic.com";
            string path2 = @"products";

            // Call method
            string result = Path.CombineUrls(path1, path2);

            // Validate
            Assert.AreEqual(@"http://www.catenalogic.com/products", result);
        }
Example #4
0
        public void CombineUrls_3ValuesAnd1Empty()
        {
            // Declare variables
            string path1 = @"/products";
            string path2 = @"";
            string path3 = @"/default.aspx";

            // Call method
            string result = Path.CombineUrls(path1, path2, path3);

            // Validate
            Assert.AreEqual(@"/products/default.aspx", result);
        }
Example #5
0
        public void CombineUrls_3ValuesAndGarbageSlashes()
        {
            // Declare variables
            string path1 = @"http://www.catenalogic.com/";
            string path2 = @"products\";
            string path3 = @"/updater";

            // Call method
            string result = Path.CombineUrls(path1, path2, path3);

            // Validate
            Assert.AreEqual(@"http://www.catenalogic.com/products/updater", result);
        }