Пример #1
0
        public async Task GivenRetrieveMetadataRequestForStudy_WhenFailsToRetrieveAll_ThenNotFoundIsThrown()
        {
            List <DicomDataset> datasetList = SetupDatasetList(ResourceType.Study);
            string ifNoneMatch = null;

            // Add metadata for only one instance in the given list
            await _metadataStore.StoreInstanceMetadataAsync(datasetList.Last(), version : 0);

            await Assert.ThrowsAsync <ItemNotFoundException>(() => _retrieveMetadataService.RetrieveStudyInstanceMetadataAsync(_studyInstanceUid, ifNoneMatch, DefaultCancellationToken));
        }
        public async Task GivenRetrieveStudyMetadataRequest_WhenStudyInstanceUidDoesNotExist_ThenDicomInstanceNotFoundExceptionIsThrownAsync()
        {
            string ifNoneMatch = null;
            var    exception   = await Assert.ThrowsAsync <InstanceNotFoundException>(() => _retrieveMetadataService.RetrieveStudyInstanceMetadataAsync(TestUidGenerator.Generate(), ifNoneMatch, DefaultCancellationToken));

            Assert.Equal("The specified study cannot be found.", exception.Message);
        }