예제 #1
0
        public void ThrowOnUnmetDependency()
        {
            var receiver = new MethodInjectReceiver();
            var injector = new Injector();

            injector.Bind <IFakeService>(_fakeService);
            Assert.Throws <DependencyInjectionException>(() => { injector.Inject(receiver); });
        }
예제 #2
0
        public void InjectMethod()
        {
            var receiver = new MethodInjectReceiver();

            _injector.Inject(receiver);

            Assert.AreSame(_fakeService, receiver.FakeService);
            Assert.AreSame(_anotherFakeService, receiver.AnotherFakeService);
        }