protected override void Arrange()
 {
     base.Arrange();
     var reader = MockRepository.GenerateStub<IFileReader>();
     expectedEntity = new InputDataEntity
     {
             Date = DateTime.Now,
             Open = 1.1f,
             High = 2.2f,
             Low = 3.3f,
             Close = 4.4f,
             Volume = 1000
     };
     reader.Stub(m => m.GetEntities(Arg<string>.Is.Anything)).Return(new List<InputDataEntity> { expectedEntity });
     this.fileProcessor = new FileProcessor(reader, "DummyFileName");
 }
Esempio n. 2
0
 private void OnElapsedInterval(object sender)
 {
     var localFileList = watcher.FileList.ToArray();
     foreach (string file in localFileList)
     {
         var fileName = file;
         var workingFile = CopyFileToWorkingDirectory(fileName);
         watcher.FileList.Remove(fileName);
         var fileReader = this.readerFactory.GetFileReader(Path.GetExtension(workingFile));
         if (fileReader != null)
         {
             var fileProcessor = new FileProcessor(fileReader, workingFile);
             var task = new Task<DataTable>(fileProcessor.GetDataTableFromFile);
             task.ContinueWith(result => SetResult(result.Result, workingFile));
             task.Start();
         }
     }
 }