Exemple #1
0
        public async void should_stop_wiretap_correctly()
        {
            var dummyPipeline = new PipelineBuilder()
                                .StartFrom(x => Task.FromResult((object)"hello"))
                                .ThenInvoke(x => Task.FromResult((object)"there"))
                                .Build()
                                .AsWireTappable();

            Action <object, object> action = (x, y) => { Assert.True(false); };

            dummyPipeline.StartWiretap(1, action);
            dummyPipeline.StartWiretap(2, action);

            dummyPipeline.StopWiretap(1, action);
            dummyPipeline.StopWiretap(2, action);

            dummyPipeline.Execute();
        }
Exemple #2
0
        public async void should_unsubscribe_wiretap_correctly()
        {
            var dummyPipeline = new PipelineBuilder()
                                .StartFrom(x => Task.FromResult((object)"hello"))
                                .ThenInvoke(x => Task.FromResult((object)"there"))
                                .Build()
                                .AsWireTappable();

            var sub1 = dummyPipeline.StartWiretap(1, (x, y) =>
            {
                Assert.True(false);
            });
            var sub2 = dummyPipeline.StartWiretap(2, (x, y) =>
            {
                Assert.True(false);
            });

            sub1.Unsubscribe();
            sub2.Unsubscribe();

            dummyPipeline.Execute();
        }