public void Should_pull_the_implementation_for_the_type() { ComponentFactory.Add <IMyDependency>(typeof(MyDependency)); var subject = ComponentFactory.Get <MyClass>(); Assert.IsNotNull(subject); Assert.IsNotNull(subject.Dependency); Assert.IsInstanceOf <MyDependency>(subject.Dependency); Assert.IsNotNull(subject.OtherDependency); Assert.IsNotNull(subject.Dependency.Dependency); }
public void Setup() { ComponentFactory.Add(typeof(MyClass), typeof(MyClass), new[] { typeof(MyDependency) }); }
public void Setup() { ComponentFactory.Add <MyClass>(); }
public void Should_throw_an_exception() { Assert.Throws <ArgumentException>(() => ComponentFactory.Add(typeof(IB), typeof(A))); }