예제 #1
0
            public void CallShouldBeDelegatedToKernelConfiguration()
            {
                KernelConfigurationMock.Setup(p => p.AddBinding(BindingMock.Object));

                NinjectModule.AddBinding(BindingMock.Object);

                KernelConfigurationMock.Verify(p => p.AddBinding(BindingMock.Object), Times.Once());
            }
예제 #2
0
            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));
            }
예제 #3
0
            public void NoArgumentNullCheckShouldBePerformed()
            {
                const IBinding binding = null;

                KernelConfigurationMock.Setup(p => p.AddBinding(binding));

                NinjectModule.AddBinding(binding);

                KernelConfigurationMock.Verify(p => p.AddBinding(binding), Times.Once());
            }
예제 #4
0
            public void BindingShouldNotBeAddedToBindings()
            {
                Assert.Throws <NullReferenceException>(() => NinjectModule.AddBinding(BindingMock.Object));

                Assert.Empty(NinjectModule.Bindings);
            }
예제 #5
0
 public void NullReferenceExceptionShouldBeThrown()
 {
     Assert.Throws <NullReferenceException>(() => NinjectModule.AddBinding(BindingMock.Object));
 }