Exemplo n.º 1
0
        public CSharpFileFactory(IFileReader fileReader, ICacheEventHelper cacheEventHelper, IVisualStudioEventProxy visualStudioEventProxy, IVisualStudioOpenDocumentManager openDocumentManager)
        {
            _fileReader = fileReader;
            _openDocumentManager = openDocumentManager;

            WireUpCacheEvictionEvents(cacheEventHelper, visualStudioEventProxy);
        }
 public pMixinsCodeGeneratorResponseFileWriter(IFileWrapper fileWrapper, IFileReader fileReader, ICodeBehindFileHelper codeBehindFileHelper, IVisualStudioOpenDocumentManager visualStudioOpenDocumentManager)
 {
     _fileWrapper = fileWrapper;
     _fileReader = fileReader;
     _codeBehindFileHelper = codeBehindFileHelper;
     _visualStudioOpenDocumentManager = visualStudioOpenDocumentManager;
 }
Exemplo n.º 3
0
 public FileReaderLoggerDecorator(
     IFileReader decorated,
     ILogger logger)
 {
     this.decorated = decorated;
     this.logger = logger;
 }
Exemplo n.º 4
0
 public Highscore()
 {
     this.fileReader = new FileReader(this.highscoreExternalFileName);
     this.fileWriter = new FileWriter(this.highscoreExternalFileName);
     this.players = new List<IPlayer>();
     this.GenerateListWithTopPlayers(5);
 }
Exemplo n.º 5
0
        private static void ExecuteFiles(IFileReader fileReader, string[] files)
        {
            FileManager manager = new FileManager();
            manager.Printed += Manager_Printed;

            for (int fileIndex = 0; fileIndex < files.Length; fileIndex++)
            {
                try
                {
                    string fileName = files[fileIndex];
                    System.Console.WriteLine("file: " + fileName + ":");
                    System.Console.WriteLine("-------------------------------------------------------------------");

                    StringCollection comands = fileReader.Read(fileName);
                    StringCollectionToConsole(comands);
                    System.Console.WriteLine();

                    manager.Reset();
                    manager.ExecuteBatch(comands);

                    System.Console.WriteLine(manager);
                    System.Console.WriteLine();
                }
                catch (Exception ex)
                {
                    System.Console.WriteLine(manager);
                    System.Console.WriteLine(ex.Message);
                    System.Console.WriteLine();
                }
            }

            Pause();
        }
Exemplo n.º 6
0
        public InputFilter(IFileReader fileReader)
        {
            if (fileReader == null)
                throw new ArgumentNullException("Needs a valid filereader");

            this.fileReader = fileReader;
        }
Exemplo n.º 7
0
 public LessHandlerImpl(IHttp http, IResponse response, ILessEngine engine, IFileReader fileReader)
 {
     Http = http;
     Response = response;
     Engine = engine;
     FileReader = fileReader;
 }
Exemplo n.º 8
0
 public WebImporter(IFileReader reader,
     bool disableUrlRewriting,
     bool inlineCssFile,
     bool importAllFilesAsLess)
     : base(reader, disableUrlRewriting, inlineCssFile, importAllFilesAsLess)
 {
 }
Exemplo n.º 9
0
        public MockTwitterApi ()
        {
            _reader = IocContainer.GetContainer().Resolve<IFileReader>();
            _settings = new JsonSerializerSettings ();

            _settings.DateFormatString = "ddd MMM dd HH:mm:ss zzzz yyyy";
            _settings.Culture = CultureInfo.InvariantCulture;
        }
Exemplo n.º 10
0
 public Importer(IFileReader fileReader, bool disableUrlReWriting, bool inlineCssFiles, bool importAllFilesAsLess)
 {
     FileReader = fileReader;
     IsUrlRewritingDisabled = disableUrlReWriting;
     InlineCssFiles = inlineCssFiles;
     ImportAllFilesAsLess = importAllFilesAsLess;
     Imports = new List<string>();
 }
 public DefaultCommandLineRunner(IActionStepsFinder actionStepsFinder, IFeatureRunner featureRunner, IFeatureFileFinder featureFileFinder, IGherkinParser gherkinParser, IFileReader fileReader)
 {
     this.actionStepsFinder = actionStepsFinder;
     this.featureRunner = featureRunner;
     this.featureFileFinder = featureFileFinder;
     this.gherkinParser = gherkinParser;
     this.fileReader = fileReader;
 }
Exemplo n.º 12
0
 public HtmlReporter(IHtmlReportConfiguration configuration, IReportBuilder builder, 
     IReportWriter writer, IFileReader reader)
 {
     _configuration = configuration;
     _builder = builder;
     _writer = writer;
     _fileReader = reader;
 }
Exemplo n.º 13
0
        public ScanningService(ILineProcessor lineProcessor, IDataAccess dataAccess, IFileReader fileReader)
        {
            _lineProcessor = lineProcessor;
            _dataAccess = dataAccess;
            _fileReader = fileReader;

            Mapper.CreateMap<WordItem, WordModel>();
        }
 public TestableHtmlReporter(IHtmlReportConfiguration configuration, IReportBuilder reportBuilder, IReportWriter writer, IFileReader fileReader) 
     : base(configuration, reportBuilder, writer, fileReader)
 {
     Configuration = configuration;
     ReportBuilder = reportBuilder;
     Writer = writer;
     FileReader = fileReader;
     Configuration.RunsOn(Arg.Any<Story>()).Returns(true);
 }
Exemplo n.º 15
0
		internal RegistrationRepository(string file, ISynchronizer synchronizer, IFileReader reader, IFileWriter writer)
		{
			_synchronizer = synchronizer;
			_reader = reader;
			_writer = writer;

			_serializer = new JavaScriptSerializer();
			_file = file;
		}
Exemplo n.º 16
0
		public FileProvider(IFileReader fileReader)
		{
			_fileReader = fileReader;
			var defaultSpecifications = new IToggleSpecification[]
			{
				new TrueSpecification(), new FalseSpecification()
			};
			_specifications = defaultSpecifications.ToDictionary(x => x.Name, StringComparer.OrdinalIgnoreCase);
		}
Exemplo n.º 17
0
        public void setup()
        {
            // sub the file reader
            file_reader = Substitute.For<IFileReader>();
            file_reader.Read( "foo_path" ).Returns( "foo_json" );

            // sub the json reader
            json_reader = Substitute.For<IJsonReader>();
            json_reader.Serialize<TestAsset>( "foo_json" ).Returns( new TestAsset() { TestString = "Bar" } );
        }
Exemplo n.º 18
0
        internal RazorMailMessage(string subject, Assembly assembly, IFileReader fileReader)
        {
            Message = new MailMessage();

            Message.Subject = subject;
            Encoding = Encoding.UTF8;

            Templates = new TemplateCollection(assembly, fileReader ?? new FileReader());
            Set = new ExpandoObject();
        }
Exemplo n.º 19
0
 public Importer(IFileReader fileReader, bool disableUrlReWriting, string rootPath, bool inlineCssFiles, bool importAllFilesAsLess)
 {
     FileReader = fileReader;
     IsUrlRewritingDisabled = disableUrlReWriting;
     RootPath = rootPath;
     InlineCssFiles = inlineCssFiles;
     ImportAllFilesAsLess = importAllFilesAsLess;
     Imports = new List<string>();
     CurrentDirectory = "";
 }
 private static ItemDeserializer SetupClass(IPathFacade pathFacade = null,
     IEditorLogger logger = null,
     IProjectLoader projectLoader = null,
     IObjectDumper objectDumper = null,
     IXmlDeserializer xmlDeserializer = null,
     IFileReader fileReader = null)
 {
     return
         new
             ItemDeserializer(pathFacade, logger, projectLoader, objectDumper, xmlDeserializer, fileReader);
 }
Exemplo n.º 21
0
 public Application(
     IApplicationArgumentsGetter applicationArgumentsGetter,
     ILoggingSystemInitializer loggingSystemInitializer,
     IFileReader<Configuration.Configuration> configurationReader,
     ITcpServer tcpServer, IHttpRequestProcessor httpRequestProcessor)
 {
     _applicationArgumentsGetter = applicationArgumentsGetter;
     _loggingSystemInitializer = loggingSystemInitializer;
     _configurationReader = configurationReader;
     _tcpServer = tcpServer;
     _httpRequestProcessor = httpRequestProcessor;
 }
 public SettingsSerializer(IApplication application,
     IFileFacade fileFacade,
     IPathFacade pathFacade,
     IXmlSerializer xmlSerializer, IXmlDeserializer xmlDeserializer,
     IFileWriter fileWriter, IFileReader fileReader)
 {
     this.application = application;
     this.fileFacade = fileFacade;
     this.pathFacade = pathFacade;
     this.xmlSerializer = xmlSerializer;
     this.xmlDeserializer = xmlDeserializer;
     this.fileWriter = fileWriter;
     this.fileReader = fileReader;
 }
        public ItemDeserializer(IPathFacade pathFacade,
            IEditorLogger logger,
            IProjectLoader projectLoader,
            IObjectDumper objectDumper,
            IXmlDeserializer xmlDeserializer,
            IFileReader fileReader)
            : base(pathFacade, logger, projectLoader)
        {
            Check.IfIsNull(objectDumper).Throw<ArgumentNullException>(() => objectDumper);
            Check.IfIsNull(xmlDeserializer).Throw<ArgumentNullException>(() => xmlDeserializer);
            Check.IfIsNull(fileReader).Throw<ArgumentNullException>(() => fileReader);

            this.objectDumper = objectDumper;
            this.xmlDeserializer = xmlDeserializer;
            this.fileReader = fileReader;
        }
Exemplo n.º 24
0
 public DisplayCoordinator(IFileReader fileReader, IFormatter formatter, IConsole console)
 {
     _possibleInteractions = new IInteraction[]
                      {
                        new Exit(),
                        new NextPage(),
                        new PreviousPage(),
                        new LastPage(),
                        new FirstPage(),
                        new JumpToPage(console),
                        new NoOp()
                      };
       _fileReader = fileReader;
       _formatter = formatter;
       _console = console;
 }
Exemplo n.º 25
0
        public void ParseNext(IFileReader reader, IRowParsingContext rowParsingContext)
        {
            ResetParsingState();

            ParsingResult parsingResult = ParsingResult.Match;
            char currentChar = '\0';

            do
            {
                if (currentText.Length >= ParsingBufferMaxSize)
                {
                    ParsingBufferOverflowException ex = new ParsingBufferOverflowException();
                    if (rowParsingContext != null)
                    {
                        ex.ColumnIndex = rowParsingContext.ColumnCount;
                    }
                    throw ex;
                }

                if (parsingResult != ParsingResult.Miss)
                {
                    currentChar = reader.GetNextChar();
                    if (reader.IsEOF)
                    {
                        break;
                    }
                    else if (rowParsingContext != null)
                    {
                        rowParsingContext.Append(currentChar);
                    }
                }

                if (this.currentParsingState != null)
                {
                    parsingResult = currentParsingState.ProcessCharacter(this, currentChar);
                }
                else
                {
                    // We should not get into this state for our parsing.
                    // It would mean our graph of states is not connected properly.
                    throw new FieldParsingException(MessageStrings.BadParsingGraphError);
                }
            }
            while (parsingResult != ParsingResult.Done);
        }
        public void SkipHeaderRows(IFileReader reader)
        {
            ArgumentVerifier.CheckObjectArgument(reader, "reader");

            if (this.headerRowsToSkip > 0 && !string.IsNullOrEmpty(this.headerRowDelimiter))
            {
                FieldParser headerRowFieldParser = FieldParser.BuildParserWithSingleDelimiter(this.headerRowDelimiter);

                for (int i = 0; i < this.headerRowsToSkip; i++)
                {
                    headerRowFieldParser.ParseNext(reader);
                    if (reader.IsEOF)
                    {
                        break;
                    }
                }
            }
        }
Exemplo n.º 27
0
        public void ParseNextRow(IFileReader reader, RowData rowData)
        {
            ArgumentVerifier.CheckObjectArgument(reader, "reader");

            if (rowData != null)
            {
                rowData.ResetRowData();
            }
            this.fieldParser.ResetParsingState();

            if (this.singleColumn)
            {
                fieldParser.ParseNext(reader, rowData);
                if (rowData != null)
                {
                    string columnData = fieldParser.CurrentText;
                    if (!reader.IsEOF || !string.IsNullOrEmpty(columnData))
                    {
                        rowData.AddColumnData(fieldParser.CurrentText);
                    }
                }
            }
            else
            {
                while (!reader.IsEOF && !this.fieldParser.RowDelimiterMatch)
                {
                    this.fieldParser.ParseNext(reader, rowData);

                    if (rowData != null)
                    {
                        string columnData = fieldParser.CurrentText;
                        if (!reader.IsEOF || rowData.ColumnCount > 0 || !string.IsNullOrEmpty(columnData))
                        {
                            if (MaxColumnNumber == rowData.ColumnCount)
                            {
                                throw new RowColumnNumberOverflow();
                            }
                            // Add data if this is not the last and empty row.
                            rowData.AddColumnData(fieldParser.CurrentText);
                        }
                    }
                }
            }
        }
Exemplo n.º 28
0
		public AutoRegistrationPlugin(ISynchronizer synchronizer,
		                              IRegistrationRepository registrationRepository,
		                              IPageRepository pageRepository,
		                              IPageFormatter pageFormatter,
		                              IEntryFormatter entryFormatter,
		                              INotificationSender notificationSender,
		                              ILogger logger,
		                              IPluginConfiguration configuration,
		                              IFileReader fileReader,
		                              ISettings settings)
		{
			_synchronizer = synchronizer;
			_fileReader = fileReader;
			_settings = settings;
			_registrationRepository = registrationRepository;
			_pageRepository = pageRepository;
			_pageFormatter = pageFormatter;
			_entryFormatter = entryFormatter;
			_notificationSender = notificationSender;
			_logger = logger;
			_configuration = configuration;
		}
 public void SkipInitialRows(IFileReader reader)
 {
     this.SkipHeaderRows(reader);
     if (!reader.IsEOF)
     {
         if (this.columnNameInFirstRow)
         {
             this.ParseNextRow(reader, null);
         }
         if (!reader.IsEOF)
         {
             for (int i = 0; i < this.dataRowsToSkip; i++)
             {
                 this.ParseNextRow(reader, null);
                 if (reader.IsEOF)
                 {
                     break;
                 }
             }
         }
     }
 }
Exemplo n.º 30
0
 //This way of injecting dependency is called
 // Poor's man dependency injection
 public VideoService(IFileReader filereader = null, IVideoRepository videoRepository = null)
 {
     _fileReader      = filereader ?? new FileReader();
     _videoRepository = videoRepository ?? new VideoRepository();
 }
Exemplo n.º 31
0
 public FileParser(IFileReader fileReader, ISpecificationMappings specificationMappings)
 {
     _fileReader            = fileReader;
     _specificationMappings = specificationMappings;
 }
Exemplo n.º 32
0
 public TriangleReader(IFileReader fileReader, ILineParser lineParser)
 {
     _fileReader = fileReader;
     _lineParser = lineParser;
 }
 public NearLosslessPredictiveEncoder(IFileReader fileReader, IFileWriter fileWriter)
 {
     this.fileReader = fileReader;
     this.fileWriter = fileWriter;
 }
 public Controller(IObjectCreator objectCreator, IFileReader fileReader)
 {
     _objectCreator = objectCreator;
     _fileReader    = fileReader;
 }
Exemplo n.º 35
0
 public LogFileReader(IFileReader fileReader, ILogger logger, ICollector collector) : base(collector)
 {
     _fileReader = fileReader;
     _logger     = logger;
     _collector  = collector;
 }
Exemplo n.º 36
0
        }                                             // Dependency injection as constructor

        public VideoService(IFileReader fileReader = null, IVideoRepository repository = null)
        {
            //FileReader = new FileReader(); // Dependency injection as property
            _fileReader = fileReader ?? new FileReader();      // Dependency injection as constructor
            _repository = repository ?? new VideoRepository(); // Dependency injection as constructor
        }
Exemplo n.º 37
0
 public Processor(IFileReader reader)
 {
     _reader         = reader;
     _fileProcessors = new Dictionary <FileType, FileProcessor.FileProcessor>();
 }
 public PrenotificationBulkUploadController(IMediator mediator, IPrenotificationValidator validator, IFileReader fileReader)
 {
     this.mediator   = mediator;
     this.validator  = validator;
     this.fileReader = fileReader;
 }
Exemplo n.º 39
0
 public Importer(IFileReader fileReader)
     : this(fileReader, false, false, false)
 {
 }
Exemplo n.º 40
0
        /// <summary>
        /// Performs the analysis of the source file.
        /// </summary>
        /// <param name="fileReader">The file reader.</param>
        /// <returns>The analysis result.</returns>
        internal FileAnalysis AnalyzeFile(IFileReader fileReader)
        {
            string error = null;

            string[] lines = fileReader.LoadFile(this.Path, out error);

            if (error != null)
            {
                Logger.Error(error);
                return(new FileAnalysis(this.Path, error));
            }

            this.TotalLines = lines.Length;

            int currentLineNumber = 0;

            var result = new FileAnalysis(this.Path);
            ICollection <Branch> branchesOfLine = null;

            foreach (var line in lines)
            {
                currentLineNumber++;
                int             visits          = this.lineCoverage.Length > currentLineNumber ? this.lineCoverage[currentLineNumber] : -1;
                LineVisitStatus lineVisitStatus = this.lineVisitStatus.Length > currentLineNumber ? this.lineVisitStatus[currentLineNumber] : Analysis.LineVisitStatus.NotCoverable;

                var lineCoverageByTestMethod = this.lineCoveragesByTestMethod
                                               .ToDictionary(
                    l => l.Key,
                    l =>
                {
                    if (l.Value.Coverage.Length > currentLineNumber)
                    {
                        return(new ShortLineAnalysis(l.Value.Coverage[currentLineNumber], l.Value.LineVisitStatus[currentLineNumber]));
                    }
                    else
                    {
                        return(new ShortLineAnalysis(-1, Analysis.LineVisitStatus.NotCoverable));
                    }
                });

                if (this.branches != null && this.branches.TryGetValue(currentLineNumber, out branchesOfLine))
                {
                    result.AddLineAnalysis(
                        new LineAnalysis(
                            visits,
                            lineVisitStatus,
                            lineCoverageByTestMethod,
                            currentLineNumber,
                            line.TrimEnd(),
                            branchesOfLine.Count(b => b.BranchVisits > 0),
                            branchesOfLine.Count));
                }
                else
                {
                    result.AddLineAnalysis(
                        new LineAnalysis(
                            visits,
                            lineVisitStatus,
                            lineCoverageByTestMethod,
                            currentLineNumber,
                            line.TrimEnd()));
                }
            }

            return(result);
        }
 public WithRepoConfigurationReader(IFileReader fileReader, Command command)
 {
     _fileReader = fileReader;
     _command    = command;
 }
Exemplo n.º 42
0
 private void GetArchivatorTools(string operation)
 {
     fileReader    = FileReaderFactory.GetFileReader(operation);
     streamQueuer  = StreamQueuerFactory.GetStreamQueuer(operation);
     gZipProcessor = GZipProcessorFactory.GetGZipProcessor(operation);
 }
Exemplo n.º 43
0
 public FileProcessor(IFileReader reader, string fileName)
 {
     this.fileReader = reader;
     this.fileName   = fileName;
 }
Exemplo n.º 44
0
 public SolutionParser(IFileReader fileReader, IDirectoryReader directoryReader, IPathReader pathReader)
 {
     _fileReader      = fileReader;
     _directoryReader = directoryReader;
     _pathReader      = pathReader;
 }
Exemplo n.º 45
0
 public MockImportService(IProductService productService, ICourierService courierService, ISupplierService supplierService, IFileReader fileReader, IValidator validator, IJsonService jsonService) : base(productService, courierService, supplierService, fileReader, validator, jsonService)
 {
 }
Exemplo n.º 46
0
 public VideoService(IFileReader fileReader = null, IVideoRepository repository = null)
 {
     this.fileReader = fileReader ?? new FileReader();
     this.repository = repository ?? new VideoRepository();
 }
Exemplo n.º 47
0
 public Day10Solution(IFileReader fileReader)
 {
     _fileReader = fileReader;
     InitAdaptersFromInput();
     ResetSolution();
 }
Exemplo n.º 48
0
 public JsonReader(string path, ConfigLoaderOptions options, IFileReader reader)
 {
     this.path       = path;
     this.options    = options;
     this.fileReader = reader;
 }
Exemplo n.º 49
0
 /// <summary>
 /// Constructor Injection for FileReader
 /// </summary>
 /// <param name="fileRead"></param>
 public BookLogic(IFileReader fileRead)
 {
     fileReader = fileRead;
     factory    = new BookReaderFactory();
 }
Exemplo n.º 50
0
 public CnabReaderEngine(IFileReader reader) : base(reader)
 {
 }
Exemplo n.º 51
0
 /// <summary>
 /// Constructor which forwards drive service instance to base class.
 /// </summary>
 public GoogleDriveReader(DriveService driveService, IFileReader fileReader)
     : base(driveService)
 {
     _localFileReader = new LocalFileReader(fileReader);
 }
 public DocFactory(IFileReader fileReader)
 {
     _fileReader = fileReader;
 }
Exemplo n.º 53
0
 public Day13Solution(IFileReader fileReader)
 {
     _fileReader = fileReader;
     InitBusesFromInput();
     ResetSolution();
 }
Exemplo n.º 54
0
 public TestCache()
 {
     _scanner    = new FileScanner(new TSql130Parser(false));
     _fileReader = new FileReader();
 }
 public ExchangeRateFileRepository(ISerializer <IEnumerable <ExchangeRate>, string> Serializer, IFileReader FileReader, IConfigurationGetter configuration)
 {
     _Serializer    = Serializer;
     _FileReader    = FileReader;
     _Configuration = configuration;
 }
Exemplo n.º 56
0
 public TestCache(FileScanner probablyAMock, IFileReader anotherMock)
 {
     _scanner    = probablyAMock;
     _fileReader = anotherMock;
 }
Exemplo n.º 57
0
 public FileContentsReader(IFileReader fileReader)
 {
     _fileReader = fileReader;
 }
Exemplo n.º 58
0
 public BehaviourTreeFileRepository(IFileReader loader, BehaviourTreeMapper mapper) : base(loader, mapper)
 {
 }
 public ConfigurableRepositoryRegistry(IFileReader fileReader, IDirectoryReader directoryReader)
 {
     _fileReader      = fileReader;
     _directoryReader = directoryReader;
     LoadConfiguration();
 }
Exemplo n.º 60
0
 public JournalProcessor(IFileReader fileReader)
 {
     _fileReader = fileReader;
     _cache = new Dictionary<FileInfo, IList<string>>();
 }