Пример #1
0
 public ISsrsObjectSource Create(string sourceIdentifier)
 {
     if (Uri.TryCreate(sourceIdentifier, UriKind.Absolute, out var uri))
     {
         if (uri.IsFile)
         {
             return(CreateFromFilesystemPath(uri.LocalPath));
         }
         var service = ReportingServiceClientFactory.CreateFromShorthandUri(uri);
         return(new SsrsWebServiceObjectSource(service));
     }
     return(CreateFromFilesystemPath(sourceIdentifier));
 }
 public void CanCreateProxyForHttpsUri()
 {
     using (var proxy = new ReportingServiceClientFactory().CreateFromShorthandUri(new Uri("https://localhost")))
     {
         try
         {
             proxy.Proxy.IsSSLRequired(new IsSSLRequiredRequest {
                 TrustedUserHeader = new TrustedUserHeader()
             });
         }
         catch (EndpointNotFoundException)
         {
             // We don't expect to find a running endpoint during the test. We just need to
             // verify that the URI is accepted.
         }
     }
 }
        public void ExpandShorthandUri(string expected, string input)
        {
            var ssrsUri = ReportingServiceClientFactory.ExpandShorthandUri(new Uri(input));

            Assert.That(ssrsUri, Is.EqualTo(new Uri(expected)));
        }