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; }
public FileReaderLoggerDecorator( IFileReader decorated, ILogger logger) { this.decorated = decorated; this.logger = logger; }
public Highscore() { this.fileReader = new FileReader(this.highscoreExternalFileName); this.fileWriter = new FileWriter(this.highscoreExternalFileName); this.players = new List<IPlayer>(); this.GenerateListWithTopPlayers(5); }
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(); }
public InputFilter(IFileReader fileReader) { if (fileReader == null) throw new ArgumentNullException("Needs a valid filereader"); this.fileReader = fileReader; }
public LessHandlerImpl(IHttp http, IResponse response, ILessEngine engine, IFileReader fileReader) { Http = http; Response = response; Engine = engine; FileReader = fileReader; }
public WebImporter(IFileReader reader, bool disableUrlRewriting, bool inlineCssFile, bool importAllFilesAsLess) : base(reader, disableUrlRewriting, inlineCssFile, importAllFilesAsLess) { }
public MockTwitterApi () { _reader = IocContainer.GetContainer().Resolve<IFileReader>(); _settings = new JsonSerializerSettings (); _settings.DateFormatString = "ddd MMM dd HH:mm:ss zzzz yyyy"; _settings.Culture = CultureInfo.InvariantCulture; }
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; }
public HtmlReporter(IHtmlReportConfiguration configuration, IReportBuilder builder, IReportWriter writer, IFileReader reader) { _configuration = configuration; _builder = builder; _writer = writer; _fileReader = reader; }
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); }
internal RegistrationRepository(string file, ISynchronizer synchronizer, IFileReader reader, IFileWriter writer) { _synchronizer = synchronizer; _reader = reader; _writer = writer; _serializer = new JavaScriptSerializer(); _file = file; }
public FileProvider(IFileReader fileReader) { _fileReader = fileReader; var defaultSpecifications = new IToggleSpecification[] { new TrueSpecification(), new FalseSpecification() }; _specifications = defaultSpecifications.ToDictionary(x => x.Name, StringComparer.OrdinalIgnoreCase); }
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" } ); }
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(); }
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); }
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; }
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; }
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; } } } }
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); } } } } }
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; } } } } }
//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(); }
public FileParser(IFileReader fileReader, ISpecificationMappings specificationMappings) { _fileReader = fileReader; _specificationMappings = specificationMappings; }
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; }
public LogFileReader(IFileReader fileReader, ILogger logger, ICollector collector) : base(collector) { _fileReader = fileReader; _logger = logger; _collector = collector; }
} // 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 }
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; }
public Importer(IFileReader fileReader) : this(fileReader, false, false, false) { }
/// <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; }
private void GetArchivatorTools(string operation) { fileReader = FileReaderFactory.GetFileReader(operation); streamQueuer = StreamQueuerFactory.GetStreamQueuer(operation); gZipProcessor = GZipProcessorFactory.GetGZipProcessor(operation); }
public FileProcessor(IFileReader reader, string fileName) { this.fileReader = reader; this.fileName = fileName; }
public SolutionParser(IFileReader fileReader, IDirectoryReader directoryReader, IPathReader pathReader) { _fileReader = fileReader; _directoryReader = directoryReader; _pathReader = pathReader; }
public MockImportService(IProductService productService, ICourierService courierService, ISupplierService supplierService, IFileReader fileReader, IValidator validator, IJsonService jsonService) : base(productService, courierService, supplierService, fileReader, validator, jsonService) { }
public VideoService(IFileReader fileReader = null, IVideoRepository repository = null) { this.fileReader = fileReader ?? new FileReader(); this.repository = repository ?? new VideoRepository(); }
public Day10Solution(IFileReader fileReader) { _fileReader = fileReader; InitAdaptersFromInput(); ResetSolution(); }
public JsonReader(string path, ConfigLoaderOptions options, IFileReader reader) { this.path = path; this.options = options; this.fileReader = reader; }
/// <summary> /// Constructor Injection for FileReader /// </summary> /// <param name="fileRead"></param> public BookLogic(IFileReader fileRead) { fileReader = fileRead; factory = new BookReaderFactory(); }
public CnabReaderEngine(IFileReader reader) : base(reader) { }
/// <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; }
public Day13Solution(IFileReader fileReader) { _fileReader = fileReader; InitBusesFromInput(); ResetSolution(); }
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; }
public TestCache(FileScanner probablyAMock, IFileReader anotherMock) { _scanner = probablyAMock; _fileReader = anotherMock; }
public FileContentsReader(IFileReader fileReader) { _fileReader = fileReader; }
public BehaviourTreeFileRepository(IFileReader loader, BehaviourTreeMapper mapper) : base(loader, mapper) { }
public ConfigurableRepositoryRegistry(IFileReader fileReader, IDirectoryReader directoryReader) { _fileReader = fileReader; _directoryReader = directoryReader; LoadConfiguration(); }
public JournalProcessor(IFileReader fileReader) { _fileReader = fileReader; _cache = new Dictionary<FileInfo, IList<string>>(); }