public void ThrowOnUnmetDependency() { var receiver = new MethodInjectReceiver(); var injector = new Injector(); injector.Bind <IFakeService>(_fakeService); Assert.Throws <DependencyInjectionException>(() => { injector.Inject(receiver); }); }
public void InjectMethod() { var receiver = new MethodInjectReceiver(); _injector.Inject(receiver); Assert.AreSame(_fakeService, receiver.FakeService); Assert.AreSame(_anotherFakeService, receiver.AnotherFakeService); }