public static IStakhanoviseSetup WithNLogLogging(this IStakhanoviseSetup setup) { if (setup == null) { throw new ArgumentNullException(nameof(setup)); } return(setup.WithLoggingProvider(new NLogLoggingProvider())); }
public static IStakhanoviseSetup WithNinjectIoCResolver(this IStakhanoviseSetup setup) { if (setup == null) { throw new ArgumentNullException(nameof(setup)); } return(setup.WithNinjectIoCResolver(new NInjectDependencyResolver())); }
private static IStakhanoviseSetup WithNinjectIoCResolver(this IStakhanoviseSetup setup, NInjectDependencyResolver resolver) { return(setup.SetupTaskExecutorRegistry(registrySetup => { registrySetup.SetupBuiltInTaskExecutorRegistry(builtInRegistrySetup => { builtInRegistrySetup.WithResolver(resolver); }); })); }
public static IStakhanoviseSetup WithNinjectIoCResolver(this IStakhanoviseSetup setup, IEnumerable <INinjectModule> existingModules) { if (setup == null) { throw new ArgumentNullException(nameof(setup)); } if (existingModules == null) { throw new ArgumentNullException(nameof(existingModules)); } return(setup.WithNinjectIoCResolver(new NInjectDependencyResolver(existingModules))); }
public void Test_CanRegisterLoggingProvider_NonNullTargetSetup() { Mock <IStakhanoviseSetup> setupMock = CreateSetupMock(); IStakhanoviseSetup targetSetup = setupMock.Object; IStakhanoviseSetup chainedSetup = targetSetup.WithLog4NetLogging(); Assert.AreSame(targetSetup, chainedSetup); setupMock.VerifyAll(); setupMock.VerifyNoOtherCalls(); }
public static IStakhanoviseSetup SetupBuiltInTaskExecutorRegistryDependencies(this IStakhanoviseSetup stakhanoviseSetup, Action <IDependencySetup> setupAction) { if (stakhanoviseSetup == null) { throw new ArgumentNullException(nameof(stakhanoviseSetup)); } if (setupAction == null) { throw new ArgumentNullException(nameof(setupAction)); } return(stakhanoviseSetup.SetupTaskExecutorRegistry(execRegSetup => execRegSetup.SetupBuiltInTaskExecutorRegistry(builtInExecRegSetup => builtInExecRegSetup.SetupDependencies(setupAction) ) )); }
public static IStakhanoviseSetup WithBuiltInTaskExecutorRegistryDependencyResolver(this IStakhanoviseSetup stakhanoviseSetup, IDependencyResolver resolver) { if (stakhanoviseSetup == null) { throw new ArgumentNullException(nameof(stakhanoviseSetup)); } return(stakhanoviseSetup.SetupTaskExecutorRegistry(execRegSetup => execRegSetup.SetupBuiltInTaskExecutorRegistry(builtInExecRegSetup => builtInExecRegSetup.WithResolver(resolver) ) )); }
public void Test_CanRegisterLoggingProvider_NullTargetSetup() { IStakhanoviseSetup targetSetup = null; Assert.Throws <ArgumentNullException>(() => targetSetup.WithLog4NetLogging()); }