public void ReturnsTheKernel() { IKernel kernel = KernelManager.GetKernel(); Assert.IsNotNull(kernel); Assert.AreEqual(@"Ninject.StandardKernel", kernel.GetType().FullName); }
public void OverridesHowKernelIsCreated() { Func <IKernel> creator = () => { return(new FakeKernel()); }; KernelManager.SetKernelResolver(creator); IKernel kernel = KernelManager.GetKernel(); Assert.AreEqual(@"fainting.goat.tests.FakeKernel", kernel.GetType().FullName); }
public void SettingToNullGoesBackToDefault() { Func <IKernel> creator = () => { return(new FakeKernel()); }; KernelManager.SetKernelResolver(creator); IKernel kernel = KernelManager.GetKernel(); Assert.AreEqual(@"fainting.goat.tests.FakeKernel", kernel.GetType().FullName); // set to null to get default behavior KernelManager.SetKernelResolver(null); kernel = KernelManager.GetKernel(); Assert.IsNotNull(kernel); Assert.AreEqual(@"Ninject.StandardKernel", kernel.GetType().FullName); }