public void BindingInterfaceToImplementation_ShouldUseSpecifiedImplementationClass() { container = new DefaultContainer(new BindingInterfaceAndImplementationConfiguration()); var emptyInterfaceInstance = container.getInstance<EmptyInterface>(); Assert.That(emptyInterfaceInstance, Is.Not.Null); Assert.That(emptyInterfaceInstance, Is.InstanceOf<DerievedFromEmptyInterface>()); }
public void BindingInterfaceToExistingInstance_ShouldUseSpecifiedObject() { container = new DefaultContainer(new BindingInterfaceAndExistingInstanceConfiguration()); var emptyInterfaceInstance = container.getInstance<EmptyInterface>(); Assert.That(emptyInterfaceInstance, Is.Not.Null); Assert.That(emptyInterfaceInstance, Is.SameAs(exampleInstance)); }
public void BindingQualifierToImplementation_ShouldUseSpecifiedImplementationClass() { container = new DefaultContainer(new BindingQualifierConfiguration()); var qualifierUsage = container.getInstance<QualifierUsageExample>(); Assert.That(qualifierUsage, Is.Not.Null); Assert.That(qualifierUsage.Property, Is.Not.Null); Assert.That(qualifierUsage.Property, Is.InstanceOf<OtherInterfaceImplementation>()); }