コード例 #1
0
        public void FormatsPath()
        {
            var builder = new HttpUrlBuilder("http://localhost");

            builder.AppendPath("foo/{0}", "bar");

            Assert.Equal("/foo/bar", builder.ToUri().AbsolutePath);
        }
コード例 #2
0
        public void DoesNotEncodeThePathSeperator()
        {
            var builder = new HttpUrlBuilder("http://localhost");

            builder.AppendPath("foo/bar");

            Assert.Equal("/foo/bar", builder.ToUri().AbsolutePath);
        }
コード例 #3
0
        public void EncodesPathArguments()
        {
            var builder = new HttpUrlBuilder("http://localhost");

            builder.AppendPath("foo/{0}", "bar#bar");

            Assert.Equal("/foo/bar%23bar", builder.ToUri().AbsolutePath);
        }
コード例 #4
0
        public void EncodesPath(string path, string expectedPath)
        {
            var builder = new HttpUrlBuilder("http://localhost");

            builder.AppendPath(path);

            Assert.Equal(expectedPath, builder.ToUri().AbsolutePath);
        }
コード例 #5
0
        public void WhenNoExistingPath_SetsAbsolutePath(string url)
        {
            var builder = new HttpUrlBuilder(url);

            builder.AppendPath("foo/bar");

            Assert.Equal("/foo/bar", builder.ToUri().AbsolutePath);
        }
コード例 #6
0
        public void AppendsPathToExisting(string url)
        {
            var builder = new HttpUrlBuilder(url);

            builder.AppendPath("foo/bar");

            Assert.Equal("/existing/path/foo/bar", builder.ToUri().AbsolutePath);
        }