public void Init() { this.injector = new InjectionContainer(); this.binder = this.injector as IBinder; //Binds some objects to use on tests. binder.Bind <IMockInterface>().To <MockIClassWithAttributes>(); binder.Bind <MockIClassWithoutAttributes>().ToSingleton().As("singleton"); binder.Bind <MockIClass>().ToSingleton(); this.containerIdentifierTests = new InjectionContainer(); var mockClass1 = new MockIClass() { property1 = "MockClass1" }; var mockClass2 = new MockIClassWithoutAttributes() { property1 = "MockClass2" }; var mockClass3 = new MockIClassWithAttributes() { property1 = "MockClass3" }; this.containerIdentifierTests.Bind <MockIClass>().To(mockClass1).As(TestIdentifier.MockClass); this.containerIdentifierTests.Bind <MockIClassWithoutAttributes>().To(mockClass2).As(TestIdentifier.MockClass); this.containerIdentifierTests.Bind <MockIClassWithAttributes>().To(mockClass3).As(TestIdentifier.MockClass); this.containerIdentifierTests.Bind <IMockInterface>().To(mockClass1).As(TestIdentifier.MockClass1); this.containerIdentifierTests.Bind <IMockInterface>().To(mockClass2).As(TestIdentifier.MockClass2); this.containerIdentifierTests.Bind <IMockInterface>().To(mockClass3).As(TestIdentifier.MockClass3); this.containerIdentifierTests.Bind <IMockInterface>().To <MockIClass>().As(TestIdentifier.MockClassSingle); }
public void Init() { this.testClass = new MockIClass() { field1 = VALUE_TO_SET, property1 = VALUE_TO_SET }; }
public void Init() { this.injector = new InjectionContainer(); this.binder = this.injector as IBinder; //Binds some objects to use on tests. binder.Bind<IMockInterface>().To<MockIClassWithAttributes>(); binder.Bind<MockIClassWithoutAttributes>().ToSingleton().As("singleton"); binder.Bind<MockIClass>().ToSingleton(); this.containerIdentifierTests = new InjectionContainer(); var mockClass1 = new MockIClass() { property1 = "MockClass1" }; var mockClass2 = new MockIClassWithoutAttributes() { property1 = "MockClass2" }; var mockClass3 = new MockIClassWithAttributes() { property1 = "MockClass3" }; this.containerIdentifierTests.Bind<MockIClass>().To(mockClass1).As(TestIdentifier.MockClass); this.containerIdentifierTests.Bind<MockIClassWithoutAttributes>().To(mockClass2).As(TestIdentifier.MockClass); this.containerIdentifierTests.Bind<MockIClassWithAttributes>().To(mockClass3).As(TestIdentifier.MockClass); this.containerIdentifierTests.Bind<IMockInterface>().To(mockClass1).As(TestIdentifier.MockClass1); this.containerIdentifierTests.Bind<IMockInterface>().To(mockClass2).As(TestIdentifier.MockClass2); this.containerIdentifierTests.Bind<IMockInterface>().To(mockClass3).As(TestIdentifier.MockClass3); this.containerIdentifierTests.Bind<IMockInterface>().To<MockIClass>().As(TestIdentifier.MockClassSingle); }