public void CanLoadFromAssembly() { var kernel = KernelEx.Create(); kernel.Load(typeof(SomeModule).Assembly); FinalModuleTests(kernel); }
public void CanLoadParallelAssemblies() { RunTestFewTimes(() => { var kernel = KernelEx.Create(); kernel.LoadParallel(new[] { typeof(SomeModule).Assembly }); FinalModuleTests(kernel); }, 100); }
public void CanLoadTwoModules() { var kernel = KernelEx.Create(); kernel.Load(new SomeModule(), new SomeModule2()); FinalModuleTests(kernel); var reverseKernel = KernelEx.Create(); reverseKernel.Load(new SomeModule2(), new SomeModule()); FinalModuleTests(reverseKernel); }
public void CanLoadOneModule() { var kernel = KernelEx.Create(); Assert.Throws <InvalidOperationException>(() => kernel.Get <string>()); //Assert.Throws<InvalidOperationException>(() => kernel.Get<IEnumerable<string>>()); Assert.False(kernel.Get <IEnumerable <string> >().Any()); Assert.False(kernel.Get <List <string> >().Any()); kernel.Load(new SomeModule()); Assert.Equal("test", kernel.Get <string>()); Assert.True(kernel.Get <IEnumerable <string> >().SequenceEqual(new[] { "str1", "str2" })); Assert.IsType <SomeModule.SomeEnumerable>(kernel.Get <IEnumerable <string> >()); Assert.True(kernel.Get <List <string> >().SequenceEqual(new[] { "test" })); kernel.Load(new SomeModule2()); FinalModuleTests(kernel); }
public RebindTests() { _kernel = KernelEx.Create(); }
public ResolvingTests() { _kernel = KernelEx.Create(); }
public ArgBindTests() { _kernel = KernelEx.Create(); }
public BasicBindTests() { _kernel = KernelEx.Create(); }
public SingletonTests() { _kernel = KernelEx.Create(); }
public DerivedBindTests() { _kernel = KernelEx.Create(); }
public InjectionTests() { _kernel = KernelEx.Create(); }