public override IOperation Extract(Process process, Entity entity, bool firstRun) { var union = new SerialUnionAllOperation(entity); foreach (var file in new DirectoryInfo(Folder).GetFiles(SearchPattern, SearchOption)) { File = file.FullName; if (Is.Excel()) { union.Add(new FileExcelExtract(this, entity)); } else { if (Is.Delimited()) { union.Add(new FileDelimitedExtract(this, entity)); } else { union.Add(new FileFixedExtract(this, entity)); } } union.Add(); } return(union); }
public void TestExtractAndFilterDatabases() { var d1 = new PartialProcessOperation(); d1.Register(new DatabaseExtract("Server=localhost;Database=master;Trusted_Connection=True;")); d1.Register(new DatabaseFilter()); d1.Register(new LogOperation()); var d2 = new PartialProcessOperation(); d2.Register(new DatabaseExtract("Server=localhost;Database=master;Trusted_Connection=True;")); d2.Register(new DatabaseFilter()); d2.Register(new LogOperation()); var union = new SerialUnionAllOperation(d1, d2); var results = TestOperation( union ); Assert.Less(0, results.Count); }