예제 #1
0
        protected override void EstablishContext()
        {
            InnerBefore = new ManualResetEvent(false);
            InnerAfter  = new ManualResetEvent(false);

            using (var scope = Input.NewSubscriptionScope())
            {
                scope.Intercept <object>(x =>
                {
                    x.BeforeEachMessage(() => BeforeCalled.Set());
                    x.AfterEachMessage(message => AfterCalled.Set());
                });

                using (var innerScope = Input.NewSubscriptionScope())
                {
                    innerScope.Intercept <object>(x =>
                    {
                        x.BeforeEachMessage(() => InnerBefore.Set());
                        x.AfterEachMessage(message => InnerAfter.Set());
                    });

                    Input.Send(new ClaimModified());
                }
            }
        }
예제 #2
0
        protected override void EstablishContext()
        {
            using (var scope = Input.NewSubscriptionScope())
            {
                scope.Intercept <object>(x =>
                {
                    x.BeforeEachMessage(() => BeforeCalled.Set());
                    x.AfterEachMessage(message => AfterCalled.Set());
                });
            }

            Input.Send(new ClaimModified());
        }
예제 #3
0
 public void Should_call_the_after_method()
 {
     Assert.IsTrue(AfterCalled.WaitOne(TimeSpan.Zero));
 }