public void RunFsa_ValidSingleWorkerConfiguration_ExpectWorkerToBeInvoked() { List<FileStoreDetails> fileStoreDetails = new List<FileStoreDetails> {new FileStoreDetails {Method = FileStoreMethod.COPY}}; FsaConfiguration fsaConfiguration = new FsaConfiguration(new EmailSummaryDetails(), fileStoreDetails); _configurationManagerMock.Setup(bll => bll.GetConfiguration(It.IsAny<FsaConfigurationLoadOptions>())).Returns(fsaConfiguration); Mock<IFsaWorker> fsaWorkerMock = new Mock<IFsaWorker>(); _fsaWorkerProviderMock.Setup(bll => bll.GetWorker(It.Is<FileStoreDetails>(fsd => fsd == fileStoreDetails[0]))).Returns(fsaWorkerMock.Object); _fileStoreArchiver.RunFsa(); fsaWorkerMock.Verify(worker => worker.Run(It.IsAny<FsaWorkerRunDetails>(), It.IsAny<IFsaLogger>()), Times.Once()); }
/// <summary> /// Invokes the fsa file store operations. /// </summary> /// <param name="fsaConfiguration">The fsa configuration.</param> /// <remarks></remarks> private void InvokeFsaFileStoreOperations(FsaConfiguration fsaConfiguration) { foreach (var fileStore in fsaConfiguration.FileStores) { IFsaWorker worker = _workerProvider.GetWorker(fileStore); worker.Run(new FsaWorkerRunDetails(fsaConfiguration, fileStore), _fsaLogger); } }