public void InjectThrowsOnUnknownDependency() { var container = Container.Create(); var resolver = container.Install(); var unknownClass = new UnknownClass(); var exception = Assert.Throws <System.Collections.Generic.KeyNotFoundException>(() => resolver.Inject(unknownClass)); }
public void InjectFillsField() { var container = Container.Create(); container.Bind <EmptyClass>().ToNew().AsCached().OnRequest(); var resolver = container.Install(); var unknownClass = new UnknownClass(); resolver.Inject(unknownClass); Assert.True(unknownClass.Empty != null); }