示例#1
0
        public void ParentUriString_should_return_self_if_already_parent()
        {
            
            var url = "http://www.nzbdrone.com";
            var uri = new Uri(url);

            
            var result = uri.ParentUriString();

            //Resolve
            result.Should().Be(url);
        }
示例#2
0
        public void ParentUriString_should_return_parent_url_when_url_with_query_strings_is_passed()
        {
            
            var url = "http://www.nzbdrone.com/test.aspx?test=10&test2=5";
            var uri = new Uri(url);

            
            var result = uri.ParentUriString();

            //Resolve
            result.Should().Be("http://www.nzbdrone.com");
        }
示例#3
0
        public void ParentUriString_should_return_parent_url_when_multiple_paths_are_passed()
        {
            
            var url = "http://www.nzbdrone.com/test/test2";
            var uri = new Uri(url);

            
            var result = uri.ParentUriString();

            //Resolve
            result.Should().Be("http://www.nzbdrone.com");
        }
示例#4
0
        public void ParentUriString_should_return_parent_url_when_url_with_path_and_query_strings_is_passed()
        {
            
            var url = "http://www.sonarr.tv/tester/test.aspx?test=10";
            var uri = new Uri(url);

            
            var result = uri.ParentUriString();

            //Resolve
            result.Should().Be("http://www.sonarr.tv");
        }
示例#5
0
        public void ParentUriString_should_return_parent_url_when_path_is_passed()
        {
            
            var url = "http://www.sonarr.tv/test/";
            var uri = new Uri(url);

            
            var result = uri.ParentUriString();

            //Resolve
            result.Should().Be("http://www.sonarr.tv");
        }
示例#6
0
        public void ParentUriString_should_return_parent_url_when_path_is_passed()
        {
            //Setup
            var url = "http://www.nzbdrone.com/test/";
            var uri = new Uri(url);

            //Act
            var result = uri.ParentUriString();

            //Resolve
            result.Should().Be("http://www.nzbdrone.com");
        }