Exemplo n.º 1
0
        public void NonGenericNamelessLazyResolveReturnsDelegateReturningObjectOfExpectedType()
        {
            using (var iocContainer = new IocContainer())
            {
                iocContainer.Register(typeof(IFoo), c => new Foo1());
                var result = iocContainer.LazyResolve(typeof(IFoo));

                Verify.That(result)
                           .IsNotNull()
                           .IsAnInstanceOfType(typeof(Func<object>));

                Verify.That(result())
                           .IsAnInstanceOfType(typeof(Foo1));
            }
        }