PageRenderTime 82ms CodeModel.GetById 40ms app.highlight 1ms RepoModel.GetById 39ms app.codeStats 0ms

/src/UnitTests/Proxy/MockInterceptor.cs

http://github.com/philiplaureano/LinFu
C# | 24 lines | 19 code | 5 blank | 0 comment | 0 complexity | 1bfe365366be3f180ef4a71c7549c58a MD5 | raw file
 1using System;
 2using LinFu.AOP.Interfaces;
 3
 4namespace LinFu.UnitTests.Proxy
 5{
 6    public class MockInterceptor : IInterceptor
 7    {
 8        private readonly Func<IInvocationInfo, object> _implementation;
 9
10        public MockInterceptor(Func<IInvocationInfo, object> implementation)
11        {
12            _implementation = implementation;
13        }
14
15        public bool Called { get; set; }
16
17
18        public object Intercept(IInvocationInfo info)
19        {
20            Called = true;
21            return _implementation(info);
22        }
23    }
24}