Ejemplo n.º 1
0
        public void Combine_UriSegments1_UriInstance()
        {
            // Arrange
            const string baseUri = "http://example.com";
            const string path    = "test";

            // Act
            var uri = UriBuilderExtensions.Combine(
                baseUri,
                path,
                "/sub-path-with-slashes/"
                );

            // Assert
            Assert.IsNotNull(uri);
            Assert.AreEqual($"{baseUri}/{path}/sub-path-with-slashes", uri.ToString());
        }
Ejemplo n.º 2
0
        public void Combine_UriSegments5_UriInstance()
        {
            // Arrange
            const string baseUri = "http://example.com";
            const string path    = "test";

            // Act
            var uri = UriBuilderExtensions.Combine(
                baseUri,
                path,
                "/sub-path-with-slashes/",
                "filename.ext?",
                "param1=1",
                "&param2=2",
                "#fragment"
                );

            // Assert
            Assert.IsNotNull(uri);
            Assert.AreEqual($"{baseUri}/{path}/sub-path-with-slashes/filename.ext?param1=1&param2=2#fragment", uri.ToString());
        }