示例#1
0
        public void does_not_throw_stack_overflow()
        {
            var kernel  = new StandardKernel();
            var adapter = new NinjectContainerAdapter(kernel);

            Assert.DoesNotThrow(() => adapter.RegisterGeneric(typeof(IGenericInterface <>), typeof(GenericImpl <>)));
        }
示例#2
0
        public void registers_generic_types_correctly()
        {
            var kernel  = new StandardKernel();
            var adapter = new NinjectContainerAdapter(kernel);

            adapter.RegisterGeneric(typeof(IGenericInterface <>), typeof(GenericImpl <>));

            var instance = kernel.Get <IGenericInterface <string> >();

            Assert.NotNull(instance);
            Assert.That(instance, Is.TypeOf(typeof(GenericImpl <string>)));
        }