Beispiel #1
0
 public ServerSchedulerFactory()
 {
     _factory = new TaskServiceConvertorFactory();
     _service = new Dev2TaskService(ConvertorFactory);
     _dir     = new DirectoryHelper();
     CreateDir();
 }
Beispiel #2
0
 public void Setup()
 {
     _interactionInvoker = Substitute.For <IInteractionInvoker>();
     _directoryHelper    = Substitute.For <IDirectoryHelper>();
     _someFilePath       = Path.Combine(_someDirectory, _someFile);
     _translation        = new InteractiveWorkflowTranslation();
 }
 public BrowseFileCommandBuilder(IDirectoryHelper directoryHelper, IFileNameQuery fileNameQuery, IInteractionRequest interactionRequest, ITranslationFactory translationFactory)
 {
     _directoryHelper    = directoryHelper;
     _fileNameQuery      = fileNameQuery;
     _interactionRequest = interactionRequest;
     _translationFactory = translationFactory;
 }
Beispiel #4
0
 internal DynamicCoverageDataCollectorImpl(IVanguard vanguard, IDirectoryHelper directoryHelper, IFileHelper fileHelper, IProfilersLocationProvider profilersLocationProvider)
 {
     this.Vanguard                  = vanguard;
     this.directoryHelper           = directoryHelper;
     this.fileHelper                = fileHelper;
     this.profilersLocationProvider = profilersLocationProvider;
 }
Beispiel #5
0
 protected TagReaderBase(IEventAggregator eventAggregator, IDirectoryHelper directoryHelper,
                         IEnvironmentProxy environmentProxy)
 {
     EventAggregator       = eventAggregator;
     this.directoryHelper  = directoryHelper;
     this.environmentProxy = environmentProxy;
 }
 public AutosaveOutputFileMover(IDirectory directory, IFile file, IPathUtil pathUtil, IDirectoryHelper directoryHelper)
 {
     Directory       = directory;
     File            = file;
     PathUtil        = pathUtil;
     DirectoryHelper = directoryHelper;
 }
 public AutosaveOutputFileMover(IUniqueFilenameFactory uniqueFilenameFactory, IFile file, IPathUtil pathUtil, IDirectoryHelper directoryHelper)
 {
     UniqueFilenameFactory = uniqueFilenameFactory;
     File            = file;
     PathUtil        = pathUtil;
     DirectoryHelper = directoryHelper;
 }
Beispiel #8
0
        public EpubContentReader(string file, SettingsBase settings, IDirectoryHelper directory)
        {
            var bookZip  = ZipFile.Open(file, ZipArchiveMode.Update);
            var tempFile = Path.Combine(settings.TempDirectory, Path.GetFileNameWithoutExtension(file));

            bookZip.ExtractToDirectory(tempFile);
            bookZip.Dispose();
            var contentInfoFile = directory.GetFiles(tempFile, "*.opf", SearchOption.AllDirectories).FirstOrDefault(f => f.EndsWith(".opf"));

            var doc              = XDocument.Load(contentInfoFile);
            var elements         = doc.Root.Elements();
            var metadata         = elements.Where(e => e.Name.LocalName == "metadata").FirstOrDefault();
            var metaDataElements = metadata.Elements();

            this.title   = metaDataElements.Where(e => e.Name.LocalName == "title").FirstOrDefault().Value;
            this.creator = metaDataElements.Where(e => e.Name.LocalName == "creator").FirstOrDefault().Value;
            var coverInfoElement = metaDataElements.Where(e => e.Attributes("name").Where(a => a.Value == "cover").FirstOrDefault() != null).FirstOrDefault();

            coverLocation = "";
            if (coverInfoElement != null)
            {
                var coverValue        = coverInfoElement.Attributes("content").FirstOrDefault().Value;
                var manifest          = elements.Where(e => e.Name.LocalName == "manifest").FirstOrDefault();
                var manifestElements  = manifest.Elements();
                var coverManifest     = manifestElements.Where(e => e.Attributes("id").FirstOrDefault() != null && e.Attributes("id").FirstOrDefault().Value == coverValue).FirstOrDefault();
                var coverHref         = coverManifest.Attributes("href").FirstOrDefault().Value;
                var fullCoverLocation = Path.Combine(Path.GetDirectoryName(contentInfoFile), coverHref.Replace("/", "\\"));
                coverLocation = fullCoverLocation;
            }
        }
Beispiel #9
0
        public void Setup()
        {
            _settings           = new PdfCreatorSettings(null);
            _jobInfoQueue       = Substitute.For <IJobInfoQueue>();
            _interactionRequest = new UnitTestInteractionRequest();
            _file                      = Substitute.For <IFile>();
            _directoryHelper           = Substitute.For <IDirectoryHelper>();
            _interactiveProfileChecker = Substitute.For <IInteractiveProfileChecker>();

            _pdfProfile = new ConversionProfile
            {
                Name             = "PDF Profile",
                OutputFormat     = OutputFormat.Pdf,
                FileNameTemplate = "X:\\test.pdf",
                TargetDirectory  = "c:\\Test\\"
            };

            _pngProfile = new ConversionProfile
            {
                Name             = "PDF Profile",
                OutputFormat     = OutputFormat.Png,
                FileNameTemplate = "X:\\test.png",
                TargetDirectory  = "c:\\Test\\"
            };

            _settings.ConversionProfiles.Add(_pdfProfile);
            _settings.ConversionProfiles.Add(_pngProfile);
        }
 public ServerSchedulerFactory()
 {
     _factory = new TaskServiceConvertorFactory();
     _service = new Dev2TaskService(ConvertorFactory);
     _dir = new DirectoryHelper();
     CreateDir();
 }
Beispiel #11
0
        public CodeQualitySolution(string basePath, IDirectoryHelper directoryHelper, INuGetPathHelper nuGetPathHelper, IFileHelper fileHelper, IProjectFactory projectFactory)
        {
            _directoryHelper = directoryHelper;
            _nuGetPathHelper = nuGetPathHelper;
            _fileHelper      = fileHelper;

            if (!Path.IsPathRooted(basePath))
            {
                throw new ArgumentOutOfRangeException(nameof(basePath), "The base path of the solution must be absolute.");
            }

            _basePath = basePath;

            var solutionFilePath = _directoryHelper.GetFiles(".", "*.sln", SearchOption.TopDirectoryOnly, _basePath).FirstOrDefault();

            _solutionFileName = Path.GetFileName(solutionFilePath);
            if (HasSolutionFile)
            {
                _logger.LogInformation($"Using solution file: {_solutionFileName}");
            }
            else
            {
                _logger.LogWarning("No solution file found.");
            }

            var projectFiles = _directoryHelper.GetFiles(".", "*.csproj", SearchOption.AllDirectories, _basePath);

            foreach (var projectFile in projectFiles)
            {
                _projects.Add(projectFactory.CreateProject(Path.GetFullPath(Path.Combine(_basePath, projectFile))));
            }
        }
Beispiel #12
0
        public EpubContentReader(string file, SettingsBase settings, IDirectoryHelper directory)
        {
            var bookZip = ZipFile.Open(file, ZipArchiveMode.Update);
            var tempFile = Path.Combine(settings.TempDirectory, Path.GetFileNameWithoutExtension(file));
            bookZip.ExtractToDirectory(tempFile);
            bookZip.Dispose();
            var contentInfoFile = directory.GetFiles(tempFile, "*.opf", SearchOption.AllDirectories).FirstOrDefault(f => f.EndsWith(".opf"));

            var doc = XDocument.Load(contentInfoFile);
            var elements = doc.Root.Elements();
            var metadata = elements.Where(e => e.Name.LocalName == "metadata").FirstOrDefault();
            var metaDataElements = metadata.Elements();
            this.title = metaDataElements.Where(e => e.Name.LocalName == "title").FirstOrDefault().Value;
            this.creator = metaDataElements.Where(e => e.Name.LocalName == "creator").FirstOrDefault().Value;
            var coverInfoElement = metaDataElements.Where(e => e.Attributes("name").Where(a => a.Value == "cover").FirstOrDefault() != null).FirstOrDefault();
            coverLocation = "";
            if (coverInfoElement != null)
            {
                var coverValue = coverInfoElement.Attributes("content").FirstOrDefault().Value;
                var manifest = elements.Where(e => e.Name.LocalName == "manifest").FirstOrDefault();
                var manifestElements = manifest.Elements();
                var coverManifest = manifestElements.Where(e => e.Attributes("id").FirstOrDefault() != null && e.Attributes("id").FirstOrDefault().Value == coverValue).FirstOrDefault();
                var coverHref = coverManifest.Attributes("href").FirstOrDefault().Value;
                var fullCoverLocation = Path.Combine(Path.GetDirectoryName(contentInfoFile), coverHref.Replace("/", "\\"));
                coverLocation = fullCoverLocation;
            }
        }
Beispiel #13
0
        public JsonDataContext()
        {
            this.directoryHelper = new DirectoryHelper();
            location             = @"C:\Users\pgathany\Desktop\Personal\Json";
            if (!directoryHelper.Exists(location))
            {
                directoryHelper.CreateDirectory(location);
            }
            this.dbLocation = location + @"\" + typeof(T).Name + ".json";
            if (!File.Exists(dbLocation))
            {
                File.Create(dbLocation).Close();
            }

            using (StreamReader r = new StreamReader(dbLocation))
            {
                string json = r.ReadToEnd();
                items = JsonConvert.DeserializeObject <List <T> >(json);
            }
            if (items == null)
            {
                items = new List <T>();
            }
            if (items.Any())
            {
                NextID = items.Select(b => (b as Entity).ID).Max() + 1;
            }
        }
 public void SetUp()
 {
     _personDeserializerFactory = A.Fake <IPersonDeserializerFactory>();
     _directoryHelper           = A.Fake <IDirectoryHelper>();
     _fileHelper      = A.Fake <IFileHelper>();
     _pathHelper      = A.Fake <IPathHelper>();
     _objectUnderTest = new PeopleCache(_personDeserializerFactory, _directoryHelper, _fileHelper, _pathHelper);
 }
Beispiel #15
0
 public ServerSchedulerFactory(Func <IScheduledResource, string> pathResolve)
 {
     _pathResolve = pathResolve;
     _factory     = new TaskServiceConvertorFactory();
     _service     = new Dev2TaskService(ConvertorFactory);
     _dir         = new DirectoryHelper();
     CreateDir();
 }
 public SolutionCleaner(IDirectoryHelper directoryHelper, IFileHelper fileHelper, IOptions options,
                        IRemoveSourceControlBindings removeSourceControlBindings, INotificationHelper notificationHelper)
 {
     this._directoryHelper             = directoryHelper;
     this._fileHelper                  = fileHelper;
     this._removeSourceControlBindings = removeSourceControlBindings;
     this._options            = options;
     this._notificationHelper = notificationHelper;
 }
 public InteractiveOutputFileMover(IDirectory directory, IFile file, IPathUtil pathUtil, IRetypeFileNameQuery retypeFileNameQuery, IDispatcher dispatcher, IDirectoryHelper directoryHelper)
 {
     _dispatcher         = dispatcher;
     Directory           = directory;
     DirectoryHelper     = directoryHelper;
     File                = file;
     PathUtil            = pathUtil;
     RetypeFileNameQuery = retypeFileNameQuery;
 }
 public PeopleCache(IPersonDeserializerFactory personDeserializerFactory,
                    IDirectoryHelper directoryHelper,
                    IFileHelper fileHelper,
                    IPathHelper pathHelper)
 {
     _fileNameBasedPeopleDictionary = new ConcurrentDictionary <string, IEnumerable <Person> >();
     _personDeserializerFactory     = personDeserializerFactory;
     _directoryHelper = directoryHelper;
     _fileHelper      = fileHelper;
     _pathHelper      = pathHelper;
 }
 public void SetUp()
 {
     _directoryPathValidator = A.Fake <IDirectoryHelper>();
     _notifier                             = A.Fake <INotifier>();
     _pathHelper                           = A.Fake <IPathHelper>();
     _directoryMonitor                     = A.Fake <IDirectoryMonitor>();
     _peopleCache                          = A.Fake <IPeopleCache>();
     _peopleAverageAgeEvaluator            = A.Fake <IPeopleAverageAgeEvaluator>();
     _averagePeopleAgePerCountrySerializer = A.Fake <ISerializer <AveragePeopleAgePerCountry> >();
     _fileHelper                           = A.Fake <IFileHelper>();
     _objectUnderTest                      = new AgeAggregatorService(_directoryPathValidator, _notifier, _pathHelper, _directoryMonitor, _peopleCache, _peopleAverageAgeEvaluator, _averagePeopleAgePerCountrySerializer, _fileHelper);
 }
Beispiel #20
0
        public FrmMain()
        {
            InitializeComponent();
            _commandExecuter = new CommandExecuterService();
            _commandExecuter.AddUpdateObserver(this);
            _cacHelper = new GacHelperService(GetTargetDirectory, _commandExecuter);
            _directoryHelperService = new DirectoryHelperService(GetTargetDirectory, _cacHelper);
            mylist.ItemChecked     += Mylist_ItemChecked;
            RefreshButtonByCheck();

            _MyCOMAdmin = new MyCOMAdmin();
        }
Beispiel #21
0
 public SaveConfigurationOperation(
     IConverterOptions options,
     IDirectoryHelper directoryHelper,
     IFileProxy fileProxy,
     IFolderProxy folderProxy,
     IOutputConfigurationFileHelper outputConfigurationHelper)
 {
     this.options                   = options;
     this.directoryHelper           = directoryHelper;
     this.fileProxy                 = fileProxy;
     this.folderProxy               = folderProxy;
     this.outputConfigurationHelper = outputConfigurationHelper;
 }
Beispiel #22
0
 public JobRunner(ITokenReplacerFactory tokenReplacerFactory,
                  IPdfProcessor processor, IConverterFactory converterFactory, IActionManager actionManager,
                  IJobCleanUp jobClean, ITempFolderProvider tempFolderProvider, IDirectory directory, IDirectoryHelper directoryHelper)
 {
     _tokenReplacerFactory = tokenReplacerFactory;
     _processor            = processor;
     _converterFactory     = converterFactory;
     _actionManager        = actionManager;
     _jobClean             = jobClean;
     _tempFolderProvider   = tempFolderProvider;
     _directory            = directory;
     _directoryHelper      = directoryHelper;
 }
Beispiel #23
0
        public ServerSchedulerFactory(IDev2TaskService service, ITaskServiceConvertorFactory factory, IDirectoryHelper directory)
        {
            var nullables = new Dictionary <string, object>
            {
                { "service", service },
                { "factory", factory },
                { "directory", directory },
            };

            VerifyArgument.AreNotNull(nullables);
            _service = service;
            _factory = factory;
            _dir     = directory;
            CreateDir();
        }
        public ServerSchedulerFactory(IDev2TaskService service, ITaskServiceConvertorFactory factory, IDirectoryHelper directory)
        {
            var nullables = new Dictionary<string, object>
                {
                    {"service", service},
                    {"factory", factory},
                    {"directory", directory},

                };
            VerifyArgument.AreNotNull(nullables);
            _service = service;
            _factory = factory;
            _dir = directory;
            CreateDir();
        }
Beispiel #25
0
        public HikDownloader(
            AppConfig appConfig,
            ILogger logger,
            IEmailHelper emailHelper,
            IDirectoryHelper directoryHelper,
            IHikClientFactory clientFactory,
            IProgressBarFactory progressFactory)
        {
            this.appConfig = appConfig;

            this.logger          = logger;
            this.emailHelper     = emailHelper;
            this.directoryHelper = directoryHelper;
            this.clientFactory   = clientFactory;
            this.progressFactory = progressFactory;
        }
Beispiel #26
0
        public AttachmentManager(DataCollectionSink dataSink, DataCollectionContext dataCollectionContext, TestPlatformLogger logger, TestPlatformEqtTrace eqtTrace, string reportDirectoryName, IFileHelper fileHelper, IDirectoryHelper directoryHelper, ICountDownEvent countDownEvent)
        {
            // Store input variabless
            _dataSink = dataSink;
            _dataCollectionContext = dataCollectionContext;
            _logger          = logger;
            _eqtTrace        = eqtTrace;
            _fileHelper      = fileHelper;
            _directoryHelper = directoryHelper;
            _countDownEvent  = countDownEvent;

            // Report directory to store the coverage reports.
            _reportDirectory = Path.Combine(Path.GetTempPath(), reportDirectoryName);

            // Register events
            _dataSink.SendFileCompleted += OnSendFileCompleted;
        }
        public AttachmentManager(DataCollectionSink dataSink, DataCollectionContext dataCollectionContext, TestPlatformLogger logger, TestPlatformEqtTrace eqtTrace, string reportFileName, string reportDirectoryName, IFileHelper fileHelper, IDirectoryHelper directoryHelper)
        {
            // Store input vars
            this.dataSink = dataSink;
            this.dataCollectionContext = dataCollectionContext;
            this.logger          = logger;
            this.eqtTrace        = eqtTrace;
            this.reportFileName  = reportFileName;
            this.fileHelper      = fileHelper;
            this.directoryHelper = directoryHelper;

            // Report directory to store the coverage reports.
            this.reportDirectory = Path.Combine(Path.GetTempPath(), reportDirectoryName);

            // Register events
            this.dataSink.SendFileCompleted += this.OnSendFileCompleted;
        }
Beispiel #28
0
        public static void ChangeScene(string sceneName)
        {
            ILogger          logger          = ContainerProvider.Scope.Resolve <ILogger>();
            IDirectoryHelper directoryHelper = ContainerProvider.Scope.Resolve <IDirectoryHelper>();

            string viewFilePath       = $"{ Directory.GetCurrentDirectory() }\\iCreator\\Views\\{ sceneName }.json";
            string controllerFilePath = $"{ directoryHelper.GetRootProjectDirectory() }iCreator\\Controllers\\{ sceneName }Controller.cs";

            if (viewExists(viewFilePath, controllerFilePath))
            {
                switchScene(viewFilePath);
            }
            else
            {
                logger.Info($"{ sceneName } does not exist.");
            }
        }
Beispiel #29
0
 public ModCopier(
     IConverterOptions options,
     IFileProxy fileProxy,
     IFolderProxy folderProxy,
     IDirectoryHelper directoryHelper,
     IMessageBoxProxy messageBoxProxy,
     IDirectoryCopyHelper directoryCopyHelper,
     ISaveGameNameTranslator nameTranslator)
 {
     this.options             = options;
     this.fileProxy           = fileProxy;
     this.folderProxy         = folderProxy;
     this.directoryHelper     = directoryHelper;
     this.messageBoxProxy     = messageBoxProxy;
     this.directoryCopyHelper = directoryCopyHelper;
     this.nameTranslator      = nameTranslator;
 }
 public AgeAggregatorService(IDirectoryHelper directoryPathValidator,
                             INotifier notifier,
                             IPathHelper pathHelper,
                             IDirectoryMonitor directoryMonitor,
                             IPeopleCache peopleCache,
                             IPeopleAverageAgeEvaluator peopleAverageAgeEvaluator,
                             ISerializer <AveragePeopleAgePerCountry> averagePeopleAgePerCountrySerializer,
                             IFileHelper fileHelper)
 {
     _directoryPathValidator = directoryPathValidator;
     _notifier                             = notifier;
     _pathHelper                           = pathHelper;
     _directoryMonitor                     = directoryMonitor;
     _peopleCache                          = peopleCache;
     _peopleAverageAgeEvaluator            = peopleAverageAgeEvaluator;
     _averagePeopleAgePerCountrySerializer = averagePeopleAgePerCountrySerializer;
     _fileHelper                           = fileHelper;
 }
Beispiel #31
0
        public void Setup()
        {
            var jobInfo = new JobInfo();

            _job = new Job(jobInfo, new ConversionProfile(), new JobTranslations(), new Accounts());
            _job.OutputFilenameTemplate = @"X:\temp\test.pdf";

            _singleTempOutputfile = new[] { @"output1.pdf" };

            _file = Substitute.For <IFile>();
            _file.Exists(Arg.Any <string>()).Returns(true);
            _directoryHelper = Substitute.For <IDirectoryHelper>();

            var path = Substitute.For <IPath>();

            _pathUtil = new PathUtil(path, Substitute.For <IDirectory>());

            _autosaveOutputFileMover = new AutosaveOutputFileMover(Substitute.For <IDirectory>(), _file, _pathUtil, _directoryHelper);
        }
Beispiel #32
0
        public RozliczenieMsAccesHelper(IUnitOfWork unitOfWork,
                                        IUnitOfWorkMsAccess unitOfWorkMsAccess,
                                        IXlsService excelReportGenerator,
                                        IEppFileGenerator eppFileGenerator,
                                        IRozliczenieSQL_RW_Helper rwHelper,
                                        IRozliczenieSQL_PW_Helper pwHelper,
                                        IDirectoryHelper directoryHelper
                                        )
        {
            this.unitOfWork         = unitOfWork;
            this.unitOfWorkMsAccess = unitOfWorkMsAccess;
            this.rwHelper           = rwHelper;
            this.pwHelper           = pwHelper;

            DirectoryHelper      = directoryHelper;
            ExcelReportGenerator = excelReportGenerator;
            EppFileGenerator     = eppFileGenerator;

            nazwaTowaruSubiekt = new NazwaTowaruSubiektHelper();
        }
Beispiel #33
0
        public InteractiveWorkflow(IShellManager shellManager, ITargetFilePathComposer targetFilePathComposer, IJobDataUpdater jobDataUpdater,
                                   IErrorNotifier errorNotifier, ISettingsProvider settingsProvider,
                                   ICommandLocator commandLocator, ILastSaveDirectoryHelper lastSaveDirectoryHelper,
                                   IDirectoryHelper directoryHelper, IInteractiveProfileChecker interactiveProfileChecker,
                                   IJobEventsManager jobEventsManager
                                   )
        {
            _shellManager              = shellManager;
            _errorNotifier             = errorNotifier;
            _settingsProvider          = settingsProvider;
            _commandLocator            = commandLocator;
            _lastSaveDirectoryHelper   = lastSaveDirectoryHelper;
            _directoryHelper           = directoryHelper;
            _interactiveProfileChecker = interactiveProfileChecker;
            _targetFilePathComposer    = targetFilePathComposer;

            JobDataUpdater          = jobDataUpdater;
            JobEventsManager        = jobEventsManager;
            _targetFilePathComposer = targetFilePathComposer;
        }
Beispiel #34
0
 public LibraryLoader(IDataContext<Book> db, SettingsBase settings)
 {
     this.db = db;
     this.directory = new DirectoryHelper();
     this.settings = settings;
 }
        private void CreateLogDirectory()
        {
            if (String.IsNullOrEmpty(logRootLocation))
            {
                logRootLocation = AppDomain.CurrentDomain.SetupInformation.ApplicationBase
                                  + @"\logs";
            }
            // logFileHelper is either injected or default instance is created
            if (directoryHelper == null)
            {
                directoryHelper = new FileDirectoryHelper(logRootLocation);
            }

            directoryHelper.CreateDirectory();

            isDirectoryCreated = true;
        }
Beispiel #36
0
 public BookSaver()
 {
     this.directory = new DirectoryHelper();
 }
Beispiel #37
0
 public OverwrittingBookSaver(IDirectoryHelper directoryHelper, string TempPath)
 {
     this.directory = directoryHelper;
     this.TempPath = TempPath;
 }
 public ConvertSaveOperation(IConverterOptions options, IFileProxy fileProxy, IDirectoryHelper directoryHelper)
 {
     this.options = options;
     this.fileProxy = fileProxy;
     this.directoryHelper = directoryHelper;
 }