Example #1
0
            public void SpecifyInterceptors(ISpecificationRegistry registry)
            {
                var matchDaoInsert = new AllOverloadsMatch(Method.Of<Model, int>(Dao.Insert));
                var surround = new CompoundInterceptor(matchDaoInsert,
                    new TraceEntry(),
                    new InvokeOriginalCall(),
                    new TraceExit());

                registry.AddInterceptor(surround);
            }
        public void SpecifyInterceptors(ISpecificationRegistry registry)
        {
            VoidAction<IInvocation> interceptor = i =>
            {
                Console.WriteLine("BEFORE CALL.");
                i.Arguments[0] = 888;
            };

            var compoundInterceptor =
                new CompoundInterceptor(new AlwaysMatches(), new BeforeCall(() => interceptor));

            registry.AddInterceptor(compoundInterceptor);
        }