private static T CreateMockObject <T>(IContext ctx)
        {
            IMockProviderCallbackProvider callBackProvider =
                ctx.Kernel.Components.Get <IMockProviderCallbackProvider>();
            IProvider factory = callBackProvider.GetCreationCallback().Invoke(ctx);

            return((T)factory.Create(ctx));
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="MockMissingBindingResolver"/> class.
 /// </summary>
 /// <param name="mockProviderCallbackProvider">The mock provider callback provider.</param>
 public MockMissingBindingResolver(IMockProviderCallbackProvider mockProviderCallbackProvider)
 {
     this.mockProviderCallbackProvider = mockProviderCallbackProvider;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="MockMissingBindingResolver"/> class.
 /// </summary>
 /// <param name="mockProviderCallbackProvider">The mock provider callback provider.</param>
 public MockMissingBindingResolver(IMockProviderCallbackProvider mockProviderCallbackProvider)
 {
     this.mockProviderCallbackProvider = mockProviderCallbackProvider;
 }
Exemple #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MockEntityFrameworkBindingResolver"/> class.
 /// </summary>
 /// <param name="mockProviderCallbackProvider">The mock provider callback provider.</param>
 public MockEntityFrameworkBindingResolver(IMockProviderCallbackProvider mockProviderCallbackProvider)
 {
     this.mockProviderCallbackProvider = mockProviderCallbackProvider;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="MockEntityFrameworkBindingResolver"/> class.
 /// </summary>
 /// <param name="mockProviderCallbackProvider">The mock provider callback provider.</param>
 public MockEntityFrameworkBindingResolver(IMockProviderCallbackProvider mockProviderCallbackProvider)
 {
     this.mockProviderCallbackProvider = mockProviderCallbackProvider;
 }
Exemple #6
0
 public NamespaceFilteringMockMissingBindingsResolver(IMockProviderCallbackProvider mockProviderCallbackProvider)
     : base(mockProviderCallbackProvider)
 {
 }