コード例 #1
0
        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);
        }
コード例 #2
0
 public BufferBlock <IList <string> > GetBufferBlock()
 {
     return(dataFlowBlockProvider.GetReadFileBufferBlock());
 }