using JamesKovacs.IoCArticle.DiyContainer.Infrastructure.Container;
using MbUnit.Framework;

namespace JamesKovacs.IoCArticle.DiyContainer.Tests.Unit.Infrastructure.Container {
    [TestFixture]
    public class IoCTests {
        [Test]
        public void CanResolveADependencyUsingSimpleDependencyResolver() {
            SimpleDependencyResolver resolver = new SimpleDependencyResolver();
            resolver.Register<IFoo>(new Foo());
            IoC.Initialize(resolver);
            IFoo foo = IoC.Resolve<IFoo>();
            Assert.IsInstanceOfType(typeof(Foo), foo);
        }
    }
}