public void CallShouldBeDelegatedToKernelConfiguration() { KernelConfigurationMock.Setup(p => p.AddBinding(BindingMock.Object)); NinjectModule.AddBinding(BindingMock.Object); KernelConfigurationMock.Verify(p => p.AddBinding(BindingMock.Object), Times.Once()); }
public void LoadShouldBeCalled() { KernelConfigurationMock.Setup(p => p.Components).Returns(ComponentsMock.Object); NinjectModule.OnLoad(KernelConfigurationMock.Object, SettingsMock.Object); Assert.Equal(1, NinjectModule.LoadCount); }
public void BindingShouldBeAddedToBindings() { KernelConfigurationMock.Setup(p => p.AddBinding(BindingMock.Object)); NinjectModule.AddBinding(BindingMock.Object); Assert.Equal(1, NinjectModule.Bindings.Count); Assert.True(NinjectModule.Bindings.Contains(BindingMock.Object)); }
public void SettingsShouldBeAssigned() { KernelConfigurationMock.Setup(p => p.Components).Returns(ComponentsMock.Object); NinjectModule.OnLoad(KernelConfigurationMock.Object, SettingsMock.Object); Assert.NotNull(NinjectModule.Settings); Assert.Same(SettingsMock.Object, NinjectModule.Settings); }
public void NoArgumentNullCheckShouldBePerformed() { const IBinding binding = null; KernelConfigurationMock.Setup(p => p.AddBinding(binding)); NinjectModule.AddBinding(binding); KernelConfigurationMock.Verify(p => p.AddBinding(binding), Times.Once()); }
public void CallShouldBeDelegatedToKernelConfiguration() { var service = typeof(string); KernelConfigurationMock.Setup(p => p.Unbind(service)); NinjectModule.Unbind(service); KernelConfigurationMock.Verify(p => p.Unbind(service), Times.Once()); }
public void NoArgumentNullCheckShouldBePerformed() { const Type service = null; KernelConfigurationMock.Setup(p => p.Unbind(service)); NinjectModule.Unbind(service); KernelConfigurationMock.Verify(p => p.Unbind(service), Times.Once()); }
public void BindingShouldBeRemovedFromBindings() { NinjectModule.Bindings.Add(BindingMock.Object); KernelConfigurationMock.Setup(p => p.RemoveBinding(BindingMock.Object)); NinjectModule.RemoveBinding(BindingMock.Object); Assert.Empty(NinjectModule.Bindings); }
public void BindingsShouldCleared() { NinjectModule.Bindings.Add(BindingMock.Object); KernelConfigurationMock.Setup(p => p.RemoveBinding(BindingMock.Object)); NinjectModule.OnUnload(); Assert.Empty(NinjectModule.Bindings); }
public void BindingsShouldBeRemovedFromKernelConfiguration() { NinjectModule.Bindings.Add(BindingMock.Object); KernelConfigurationMock.Setup(p => p.RemoveBinding(BindingMock.Object)); NinjectModule.OnUnload(); KernelConfigurationMock.Verify(p => p.RemoveBinding(BindingMock.Object), Times.Once()); }
public WhenAddBindingIsCalledAfterOnLoad() { KernelConfigurationMock.Setup(p => p.Components).Returns(ComponentsMock.Object); NinjectModule.OnLoad(KernelConfigurationMock.Object, SettingsMock.Object); }