コード例 #1
0
ファイル: Mocking.cs プロジェクト: thomashfr/AutoMoqCore
 private void RegisterThisObjectInTheIoCContainer(Type type, Mock mock)
 {
     // this is meant to replicate this generic method call
     // container.RegisterInstance<T>(mock.Object)
     _ioc.GetType()
     .GetMethods()
     .First(x => x.Name == "RegisterInstance" && x.IsGenericMethod)
     .MakeGenericMethod(type)
     .Invoke(_ioc, new[] { mock.Object });
 }