public void TestInjectOnInstance() { var mockInterface = this.binder.GetBindingsFor<IMockInterface>()[0].value; var singleton = this.binder.GetBindingsFor<MockIClassWithoutAttributes>()[0].value; var instance = new MockClassWithDependencies(); this.injector.Inject<MockClassWithDependencies>(instance); Assert.AreEqual(instance.fieldMockInterface.GetType(), mockInterface); Assert.AreEqual(instance.fieldSingleton, singleton); Assert.AreEqual(instance.propertyMockInterface.GetType(), mockInterface); Assert.AreEqual(instance.propertySingleton, singleton); }
public void TestInjectOnInstance() { var mockInterface = this.binder.GetBindingsFor <IMockInterface>()[0].value; var singleton = this.binder.GetBindingsFor <MockIClassWithoutAttributes>()[0].value; var instance = new MockClassWithDependencies(); this.injector.Inject <MockClassWithDependencies>(instance); Assert.AreEqual(instance.fieldMockInterface.GetType(), mockInterface); Assert.AreEqual(instance.fieldSingleton, singleton); Assert.AreEqual(instance.propertyMockInterface.GetType(), mockInterface); Assert.AreEqual(instance.propertySingleton, singleton); }