public async Task GivenSearchRequest_WithUnsupportedTag_ReturnBadRequest()
        {
            DicomWebException exception = await Assert.ThrowsAsync <DicomWebException>(
                () => _client.QueryStudyAsync("Modality=CT"));

            Assert.Equal(HttpStatusCode.BadRequest, exception.StatusCode);
            Assert.Equal(exception.ResponseMessage, string.Format(DicomCoreResource.UnsupportedSearchParameter, "Modality", "study"));
        }
Esempio n. 2
0
 public async Task GivenSearchRequest_WithValidParamsAndNoMatchingResult_ThenAuditLogEntriesShouldBeCreated()
 {
     await ExecuteAndValidate(
         () => _client.QueryStudyAsync("StudyDate=20200101"),
         AuditEventSubType.Query,
         "studies?StudyDate=20200101",
         HttpStatusCode.NoContent);
 }
Esempio n. 3
0
        public async Task GivenDicomRequest_WithNoAuthenticationToken_ReturnUnauthorized()
        {
            if (AuthenticationSettings.SecurityEnabled)
            {
                IDicomWebClient   client    = _fixture.GetDicomWebClient(TestApplications.InvalidClient);
                DicomWebException exception = await Assert.ThrowsAsync <DicomWebException>(
                    () => client.QueryStudyAsync(string.Empty));

                Assert.Equal(HttpStatusCode.Unauthorized, exception.StatusCode);
            }
        }
Esempio n. 4
0
 private static async Task Qido(Message message, CancellationToken token)
 {
     var queryParam = Encoding.UTF8.GetString(message.Body);
     await s_client.QueryStudyAsync(queryParam, cancellationToken : token);
 }
Esempio n. 5
0
 private static void ProcessMessageWithQueryUrl(string queryParam)
 {
     s_client.QueryStudyAsync(queryParam).Wait();
 }