public async Task GivenARequestWithInvalidStudyInstanceIdentifier_WhenHandlerIsExecuted_ThenDicomInvalidIdentifierExceptionIsThrown(string studyInstanceUid)
        {
            string ifNoneMatch = null;
            RetrieveMetadataRequest request = new RetrieveMetadataRequest(studyInstanceUid, ifNoneMatch);
            var ex = await Assert.ThrowsAsync <InvalidIdentifierException>(() => _retrieveMetadataHandler.Handle(request, CancellationToken.None));

            Assert.Equal($"DICOM Identifier 'StudyInstanceUid' value '{studyInstanceUid.Trim()}' is invalid. Value length should not exceed the maximum length of 64 characters. Value should contain characters in '0'-'9' and '.'. Each component must start with non-zero number.", ex.Message);
        }
Exemplo n.º 2
0
        public async Task GivenARequestWithInvalidStudyInstanceIdentifier_WhenHandlerIsExecuted_ThenDicomInvalidIdentifierExceptionIsThrown(string studyInstanceUid)
        {
            EnsureArg.IsNotNull(studyInstanceUid, nameof(studyInstanceUid));
            string ifNoneMatch = null;
            RetrieveMetadataRequest request = new RetrieveMetadataRequest(studyInstanceUid, ifNoneMatch);
            var ex = await Assert.ThrowsAsync <InvalidIdentifierException>(() => _retrieveMetadataHandler.Handle(request, CancellationToken.None));

            Assert.Equal(ValidationErrorCode.UidIsInvalid, ex.ErrorCode);
        }