Exemplo n.º 1
0
        public StoreScpTest(DicomAdapterFixture dicomAdapterFixture, ScpTestFileSetsFixture testFileSetsFixture)
        {
            _dicomAdapterFixture = dicomAdapterFixture;
            _testFileSetsFixture = testFileSetsFixture;

            _dicomAdapterFixture.ResetMocks();
        }
        public DicomConfigChangeTest(DicomAdapterFixture dicomAdapterFixture, ScpTestFileSetsFixture testFileSetsFixture)
        {
            _dicomAdapterFixture = dicomAdapterFixture;
            _testFileSetsFixture = testFileSetsFixture;

            dicomAdapterFixture.Jobs.Setup(p => p.Create(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <JobPriority>()))
            .ReturnsAsync(new API.Job {
                JobId = Guid.NewGuid().ToString(), PayloadId = Guid.NewGuid().ToString()
            });

            dicomAdapterFixture.Jobs.Setup(p => p.Start(It.IsAny <API.Job>()))
            .Returns(Task.CompletedTask);

            dicomAdapterFixture.Payloads.Setup(p => p.Download(It.IsAny <string>(), It.IsAny <string>()))
            .Returns(Task.FromResult(new API.PayloadFile {
                Name = Guid.NewGuid().ToString()
            }));

            dicomAdapterFixture.Payloads.Setup(p => p.Upload(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <IEnumerable <string> >()))
            .Returns(Task.CompletedTask);

            dicomAdapterFixture.ResultsService.Setup(p => p.GetPendingJobs(It.IsAny <CancellationToken>(), It.IsAny <int>()))
            .Returns(Task.FromResult((IList <TaskResponse>) new List <TaskResponse>()));

            dicomAdapterFixture.ResultsService.Setup(p => p.ReportSuccess(It.IsAny <Guid>(), It.IsAny <CancellationToken>()))
            .Returns(Task.FromResult(true));

            dicomAdapterFixture.ResultsService.Setup(p => p.ReportFailure(It.IsAny <Guid>(), It.IsAny <bool>(), It.IsAny <CancellationToken>()))
            .Returns(Task.FromResult(true));
        }