public void DownloadImages_NullStudy_ThrowsException() { // Arrange MockProvider mockProvider = new MockProvider(); StudyInfoProvider studyInfoProvider = new StudyInfoProvider(mockProvider.GetDicomQueryProviderForStudiesFake(), mockProvider.GetDicomDownloaderForStudiesFake()); // Act + Assert Assert.That(() => studyInfoProvider.DownloadImagesAsync(null).Exception.InnerExceptions[0], Is.InstanceOf<ArgumentNullException>()); }
public async void DownloadImages_ProperMethodsAreCalled() { // Arrange MockProvider mockProvider = new MockProvider(); var downloader = mockProvider.GetDicomDownloaderForStudiesFake(); StudyInfoProvider studyInfoProvider = new StudyInfoProvider(mockProvider.GetDicomQueryProviderForStudiesFake(), downloader); InfoIdentifier studyIdentifier = new InfoIdentifier("1.2.3"); StudyInfo studyInfo = new StudyInfo { StudyInstanceUID = studyIdentifier }; // Act await studyInfoProvider.DownloadImagesAsync(studyInfo); // Assert Assert.That(() => downloader.Received(1).DownloadAsync(studyIdentifier, Arg.Any<Func<InfoIdentifier, InfoIdentifier, Stream>>()), Throws.Nothing); }