예제 #1
0
        public void TryInvokeMember_ViaBase_ThrowsRuntimeBinderException()
        {
            dynamic dynamic = new DynamicEventDispatcher <NotMatchingSignatures>(new NotMatchingSignatures());

            Assert.Throws <RuntimeBinderException>(() => dynamic.When(new DummyEvent {
            }, 4));
        }
예제 #2
0
        public void Fallback_to_base()
        {
            dynamic dynamic = new DynamicEventDispatcher <WhenWithMultipleParameters>(new WhenWithMultipleParameters());

            Assert.IsEmpty(dynamic.SupportedEventTypes);
            Assert.Throws <RuntimeBinderException>(() => dynamic.When(new DummyEvent {
            }, 4));
        }
예제 #3
0
        public void Non_public_methods()
        {
            dynamic dispatcher = new DynamicEventDispatcher <WhenWithSingleArgument>(new WhenWithSingleArgument());

            Assert.Catch <Detected>(() => dispatcher.When(new DummyEvent()));
        }