public void TestDirectoryFile() { DirectoryFile df = new DirectoryFile(@"d:\", "*.txt"); DebugObserver <string> db = new DebugObserver <string>(nameof(DirectoryFile)); df.Output.Subscribe(db); }
public async Task TestTFileList() { CancellationTokenSource cts = new CancellationTokenSource(); TFileList <FilenameSchema> tf = new TFileList <FilenameSchema>(); tf.Path = @"d:\"; tf.SearchPattern = "*.txt"; DebugObserver <FilenameSchema> db = new DebugObserver <FilenameSchema>(nameof(DirectoryFile)); tf.OnOutput.SubscribeOn(scheduler).Subscribe(db); await Start(); await tf.Start(cts.Token); }
public async Task TestTFileList(int nbreOfFile) { CleanFiles(); GenerateFiles(nbreOfFile); Assert.AreEqual(nbreOfFile, Directory.EnumerateFiles(path).Count()); TFileList <FilenameSchema> liste = ctx.GetService <TFileList <FilenameSchema> >(); Assert.IsNotNull(liste); RegisterComponentForEvents(liste); liste.Path = path; liste.AddToJob(job); var dbg = new DebugObserver <FilenameSchema>(nameof(TestTFileList)); liste.OnOutput.SubscribeOn(scheduler).Subscribe(dbg); await Start(); }
private void Awake() { DebugObserver.Register(this); }
private void OnDestroy() { DebugObserver.Release(this); }