/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
- using System;
- using LinFu.AOP.Interfaces;
- namespace LinFu.UnitTests.Proxy
- {
- public class MockInterceptor : IInterceptor
- {
- private readonly Func<IInvocationInfo, object> _implementation;
- public MockInterceptor(Func<IInvocationInfo, object> implementation)
- {
- _implementation = implementation;
- }
- public bool Called { get; set; }
- public object Intercept(IInvocationInfo info)
- {
- Called = true;
- return _implementation(info);
- }
- }
- }