Example #1
0
        public void Aggregate()
        {
            var dispatcher = new AggregateDispatcher <Base, string>
            {
                (Sub1 sub1) => new[] { "sub1" },
                (Sub2 sub2) => new[] { "sub2" }
            };

            dispatcher.Dispatch(new Sub1()).Should().Equal("sub1");
            dispatcher.Dispatch(new Sub2()).Should().Equal("sub1", "sub2");
        }
Example #2
0
        public void UnknownType()
        {
            var dispatcher = new AggregateDispatcher <Base, string>();

            dispatcher.Dispatch(new Sub1()).Should().BeEmpty();
        }