예제 #1
0
        public async Task WhenRetrievingPartitions_TheServerShouldReturnAllPartitions()
        {
            var newPartition1 = TestUidGenerator.Generate();
            var newPartition2 = TestUidGenerator.Generate();

            DicomFile dicomFile = Samples.CreateRandomDicomFile();

            using DicomWebResponse <DicomDataset> response1 = await _instancesManager.StoreAsync(new[] { dicomFile }, partitionName : newPartition1);

            using DicomWebResponse <DicomDataset> response2 = await _instancesManager.StoreAsync(new[] { dicomFile }, partitionName : newPartition2);

            using DicomWebResponse <IEnumerable <PartitionEntry> > response3 = await _client.GetPartitionsAsync();

            Assert.True(response3.IsSuccessStatusCode);

            IEnumerable <PartitionEntry> values = await response3.GetValueAsync();

            Assert.Contains(values, x => x.PartitionName == newPartition1);
            Assert.Contains(values, x => x.PartitionName == newPartition2);
        }