using System; using System.Collections.Generic; using System.Reflection; using Xunit; namespace VCommon.Ioc.Tests { public class InterceptorTest { private class Interceptor : IInterceptor, ITransientIocClass { public void BeforeInvoke(Type svcClass, MethodBase svcMethod, IReadOnlyDictionary paramDic) { } public void AfterInvoke(Type svcClass, MethodBase svcMethod, IReadOnlyDictionary paramDic, object resultReturnValue, Exception resultException) { } } public interface ITestInterface { int TestMethod(int value); } private class TestClass : ITestInterface, ITransientIocClass { public int TestMethod(int value) { return value + 1; } } [Fact] public void Test() { var container = new IocManager(); var child = container.CreateChildren(); child.RegisterInstanceToContainer(child); var svc = container.Resolve(); var ret = svc.TestMethod(1); } } }