コード例 #1
0
        public void TestLinkLeftToNull2()
        {
            var faultyContainer   = new FaultyBlocks();
            var involvedContainer = new InnocentBlocks();

            faultyContainer.LinkLeftToNull();
            faultyContainer.LinkSubTypeTo(involvedContainer);
        }
コード例 #2
0
        public void TestLinkLeftToNull2()
        {
            var faultyContainer   = new FaultyBlocks();
            var involvedContainer = new InnocentBlocks();

            faultyContainer.LinkLeftToNull();
            faultyContainer.TransformAndLink(involvedContainer);
        }
コード例 #3
0
        public async Task TestTermination()
        {
            var faultyContainer   = new FaultyBlocks();
            var involvedContainer = new InnocentBlocks();

            faultyContainer.TransformAndLink(involvedContainer);
            faultyContainer.LinkLeftToNull();

            faultyContainer.InputBlock.Post("test");

            await EnsureTaskFail <SystemException>(faultyContainer.CompletionTask);
            await EnsureTaskFail <LinkedContainerFailedException>(involvedContainer.CompletionTask);
        }
コード例 #4
0
        public async Task TestTermination()
        {
            var faultyContainer   = new FaultyBlocks();
            var involvedContainer = new InnocentBlocks();

            faultyContainer.LinkTo(involvedContainer);

            var cts = new CancellationTokenSource();

            faultyContainer.RegisterCancellationTokenSource(cts);
            faultyContainer.InputBlock.Post("test");

            var sleepingTask = Task.Delay(TimeSpan.FromDays(1), cts.Token);

            await EnsureTaskFail <SystemException>(faultyContainer.CompletionTask);
            await EnsureTaskFail <LinkedDataflowFailedException>(involvedContainer.CompletionTask);

            Assert.IsTrue(await sleepingTask.FinishesIn(TimeSpan.FromSeconds(1)));
        }