예제 #1
0
		/// <summary>
		/// Gets a callback that creates an instance of the <see cref="MockProvider"/>.
		/// </summary>
		/// <returns>The created callback.</returns>
		public static Func<IContext, IProvider> GetCreationCallback(MockingKernel mockingKernel)
		{
			return ctx =>
			{
				var provider = new MockProvider(ctx.Kernel.Components.Get<IInjectorFactory>());
				mockingKernel.AddProvider(provider);
				return provider;
			};
		}
예제 #2
0
		internal void AddProvider(MockProvider provider)
		{
			mockProviders.Add(provider);
			provider.MockCreated += new MockCreatedEventHandler(provider_MockCreated);
		}