public void ConfigureServiceUris_ThrowsMalformedUriRoot()
        {
            var httpClient     = new HttpClient();
            var dicomWebClient = new DicomWebClientClass(httpClient, null);

            Assert.Throws <ArgumentNullException>(() => dicomWebClient.ConfigureServiceUris(null));
        }
        public void ConfigureAuthentication_ThrowsIfNull()
        {
            var httpClient     = new HttpClient();
            var dicomWebClient = new DicomWebClientClass(httpClient, null);
            var rootUri        = new Uri(BaseUri);

            Assert.Throws <ArgumentNullException>(() => dicomWebClient.ConfigureAuthentication(null));
        }
        public void ConfigureServicePrefix_ThrowsIfBaseAddressIsNotConfigured()
        {
            var httpClient     = new HttpClient();
            var dicomWebClient = new DicomWebClientClass(httpClient, null);
            var rootUri        = new Uri(BaseUri);

            Assert.Throws <InvalidOperationException>(() => dicomWebClient.ConfigureServicePrefix(DicomWebServiceType.Qido, "/prefix"));
        }
        public void ConfigureServiceUris_SetAllUris()
        {
            var httpClient     = new HttpClient();
            var dicomWebClient = new DicomWebClientClass(httpClient, null);
            var rootUri        = new Uri(BaseUri);

            dicomWebClient.ConfigureServiceUris(rootUri);
        }
        public void ConfigureServicePrefix_SetsServicePrefix(DicomWebServiceType serviceType, string prefix)
        {
            var httpClient     = new HttpClient();
            var dicomWebClient = new DicomWebClientClass(httpClient, null);
            var rootUri        = new Uri(BaseUri);

            dicomWebClient.ConfigureServiceUris(rootUri);
            dicomWebClient.ConfigureServicePrefix(serviceType, prefix);
        }
        public void ConfigureServicePrefix_ThrowsMalformedPrefixes(DicomWebServiceType serviceType, string prefix)
        {
            var httpClient     = new HttpClient();
            var dicomWebClient = new DicomWebClientClass(httpClient, null);
            var rootUri        = new Uri(BaseUri);

            dicomWebClient.ConfigureServiceUris(rootUri);
            Assert.Throws <ArgumentException>(() => dicomWebClient.ConfigureServicePrefix(serviceType, prefix));
        }
        public void ConfigureAuthentication_SetsAuthHeader()
        {
            var httpClient     = new HttpClient();
            var dicomWebClient = new DicomWebClientClass(httpClient, null);

            var auth = new AuthenticationHeaderValue("basic", "value");

            dicomWebClient.ConfigureAuthentication(auth);

            Assert.Equal(httpClient.DefaultRequestHeaders.Authorization, auth);
        }