public void FlightDataFlow_PostFile_CopiedToRawFolder() { var bufferBlock = dataFlow.GetReadFileBufferBlock(); DataflowLinkOptions options = new DataflowLinkOptions { PropagateCompletion = true }; var readBlock = dataFlow.ReadDeserializeJsonfiles(RAWFolder); bufferBlock.Post(new List <string>(Directory.GetFiles(InputFolder))); bufferBlock.LinkTo(readBlock, options); bufferBlock.Complete(); bufferBlock.Completion.ContinueWith(delegate { readBlock.Complete(); }); readBlock.Completion.Wait(5000); var inputFilesCount = Directory.GetFiles(InputFolder).Length; var rawFilesCount = Directory.GetFiles(RAWFolder).Length; Directory.GetFiles(RAWFolder).ToList().ForEach(file => File.Delete(file)); Assert.AreEqual(inputFilesCount, rawFilesCount); }
public BufferBlock <IList <string> > GetBufferBlock() { return(dataFlowBlockProvider.GetReadFileBufferBlock()); }