public void ShouldRetainOriginalAsyncSetting()
        {
            var aggregator = new EventBus();

            aggregator.IsAsynchronous.ShouldBe(true);
            aggregator.ShouldFire<MyEvent>(() => aggregator.Publish(new MyEvent()));
            aggregator.IsAsynchronous.ShouldBe(true);

            aggregator.IsAsynchronous = false;
            aggregator.ShouldFire<MyEvent>(() => aggregator.Publish(new MyEvent()));
            aggregator.IsAsynchronous.ShouldBe(false);
        }
        public void ShouldFireTestMethod_SpecificNumberOfTimes()
        {
            var aggregator = new EventBus();
            aggregator.ShouldFire<MyEvent>(2, () =>
                    {
                        aggregator.Publish(new MyEvent());
                        aggregator.Publish(new MyEvent());
                    });

        }
 public void ShouldFireTestMethod_SpecificNumberOfTimes_Fail()
 {
     var aggregator = new EventBus();
     Should.Throw<AssertionException>(() => aggregator.ShouldFire<MyEvent>(2, () =>
                 {
                     aggregator.Publish(new MyEvent());
                     aggregator.Publish(new MyEvent());
                     aggregator.Publish(new MyEvent());
                 }));
     Should.Throw<AssertionException>(() => aggregator.ShouldFire<MyEvent>(2, () => { }));
 }
 public void ShouldFireTestMethod_FireAtLeastOnce()
 {
     var aggregator = new EventBus();
     aggregator.ShouldFire<MyEvent>(() => aggregator.Publish(new MyEvent()));
     aggregator.ShouldFire<MyEvent>(() =>
             {
                 aggregator.Publish(new MyEvent());
                 aggregator.Publish(new MyEvent());
             });
     Should.Throw<AssertionException>(() => aggregator.ShouldFire<MyEvent>(() => { }));
 }