public void ConvertFrom ()
{
ReferenceConverter converter = new ReferenceConverter (typeof(ITestInterface));
string referenceName = "reference name";
// no context
Assert.IsNull (converter.ConvertFrom (null, null, referenceName), "#1");
TestComponent component = new TestComponent();
// context with IReferenceService
TestReferenceService referenceService = new TestReferenceService ();
referenceService.AddReference (referenceName, component);
TestTypeDescriptorContext context = new TestTypeDescriptorContext (referenceService);
Assert.AreSame (component, converter.ConvertFrom (context, null, referenceName), "#2");
// context with Component without IReferenceService
Container container = new Container ();
container.Add (component, referenceName);
context = new TestTypeDescriptorContext ();
context.Container = container;
Assert.AreSame (component, converter.ConvertFrom (context, null, referenceName), "#3");
}