public TestResultsSpreadsheetBuilder(IFileLocationProvider locationProvider,
                                      ISpreadsheetFileFactory spreadsheetFileFactory,
                                      IFormulaBuilderFactory formulaBuilderFactory)
 {
     _locationProvider       = locationProvider;
     _spreadsheetFileFactory = spreadsheetFileFactory;
     _formulaBuilderFactory  = formulaBuilderFactory;
 }
 public CreateClassFromMagisterFlow(IClassService classController,
                                    IFileLocationProvider fileLocationProvider,
                                    IDirectoryInfoWrapperFactory directoryInfoWrapperFactory)
 {
     _classController             = classController;
     _directoryInfoWrapperFactory = directoryInfoWrapperFactory;
     _magisterDirectoryLocation   = fileLocationProvider.GetClassesDirectoryPath();
 }
Beispiel #3
0
        public async Task Execute(IFileLocationProvider locationProvider)
        {
            var locations = await locationProvider.GetLocation();

            foreach (var sourceLocation in locations)
            {
                var files = await _fileProcessor.GetFilesListFromLocation(sourceLocation.LocationOnDisk);

                foreach (var file in files)
                {
                    var content = await _fileProcessor.GetFileContent(file);

                    var contentObject = JsonSerializer.Deserialize <FileContent>(content);
                    await _mediator.Send(new SumNumberCommand(contentObject, Console.WriteLine));
                }
            }
        }
Beispiel #4
0
        internal async Task Run()
        {
            _logger.LogInformation("Application {applicationEvent} at {dateTime}", "Started", DateTime.UtcNow);
            IFileLocationProvider factory = null;

            Console.WriteLine("######################################\n" +
                              "### SELECT A SOURCE FOR FILE PATHS ###\n" +
                              "######################################\n" +
                              "1) Database\n" +
                              "2) Rest server\n" +
                              "3) To quit ('Q' will work as well)\n\n\n" +
                              "Select a number: \n");

            var selection = Console.ReadLine();

            switch (selection)
            {
            case "1":
                factory = (IFileLocationProvider)_serviceProvider.GetService(typeof(CDataAccessLayer));
                break;

            case "2":
                factory = (IFileLocationProvider)_serviceProvider.GetService(typeof(FileLocationService));
                break;

            case "3":
            case "Q":
            case "q":
                Environment.Exit(0);
                break;

            default:
                Environment.Exit(0);
                break;
            }
            await _flowProvider.Execute(factory);


            Console.WriteLine("PRESS <ENTER> TO EXIT");
            _logger.LogInformation("Application {applicationEvent} at {dateTime}", "Ended", DateTime.UtcNow);
            Console.ReadKey();
        }
Beispiel #5
0
 public CsvTransactionReader(IFileLocationProvider transactionsLocationProvider, ITextStreamFactory textStreamFactory)
 {
     _transactionsLocationProvider = transactionsLocationProvider;
     _textStreamFactory            = textStreamFactory;
 }
 public JsonCategoryRuleReader(IFileLocationProvider categoryRulesLocationProvider, ITextStreamFactory textStreamFactory)
 {
     _fileLocationProvider = categoryRulesLocationProvider;
     _textStreamFactory    = textStreamFactory;
 }
        public HousekeepingBookWriter(IFileLocationProvider fileLocationProvider)
        {
            IFileInfoWrapper workbookLocation = fileLocationProvider.GetWorkbookLocation();

            _excelPackage = new ExcelPackage(workbookLocation.ToFileInfo());
        }
Beispiel #8
0
 public FilesystemSettingsProvider(IFileLocationProvider loc)
 {
     _loc = loc;
 }
Beispiel #9
0
 public ClassFileRepository(IFileLocationProvider fileLocationProvider,
                            IFileInfoWrapperFactory fileInfoWrapperFactory)
 {
     _fileLocationProvider   = fileLocationProvider;
     _fileInfoWrapperFactory = fileInfoWrapperFactory;
 }
Beispiel #10
0
 public TestFileRepository(IFileLocationProvider fileLocationProvider,
                           IFileInfoWrapperFactory fileInfoWrapperFactory)
 {
     _testRepositoryLocation = fileLocationProvider.GetTestRepositoryPath();
     _fileInfoWrapperFactory = fileInfoWrapperFactory;
 }