Esempio n. 1
0
        public void RegisterType_Valid()
        {
            var helper = new NinjectHelper();

            var container = new StandardKernel();

            Assert.IsFalse(GetRegistrationInfo(container, (typeof(ITestInterface))));

            helper.RegisterType(container, typeof(ITestInterface), typeof(TestClass1), RegistrationType.Singleton);
            Assert.IsTrue(GetRegistrationInfo(container, typeof(ITestInterface)));
        }
Esempio n. 2
0
        public void RegisterType_ImplementingTypeNull()
        {
            var helper = new NinjectHelper();

            var container = new StandardKernel();

            ExceptionTester.CallMethodAndExpectException <ArgumentNullException>(() => helper.RegisterType(container, typeof(ITestInterface), null, RegistrationType.Singleton));
        }
Esempio n. 3
0
        public void RegisterType_InvalidContainer()
        {
            var helper = new NinjectHelper();

            var container = new object();

            ExceptionTester.CallMethodAndExpectException <NotSupportedException>(() => helper.RegisterType(container, typeof(ITestInterface), typeof(TestClass1), RegistrationType.Singleton));
        }
Esempio n. 4
0
        public void RegisterType_ContainerNull()
        {
            var helper = new NinjectHelper();

            ExceptionTester.CallMethodAndExpectException <ArgumentNullException>(() => helper.RegisterType(null, typeof(ITestInterface), typeof(TestClass1), RegistrationType.Singleton));
        }