public void WithFooAndNoneRuntimeArguments_DefaultConstructorWasUsed() { var selector = new LightCore.Activation.Components.ConstructorSelector(); var finalConstructor = this.Select( typeof(Foo).GetConstructors()); Assert.That(finalConstructor, Is.Not.Null); Assert.That(finalConstructor == typeof(Foo).GetConstructor(Type.EmptyTypes)); }
private ConstructorInfo Select(IEnumerable<ConstructorInfo> constructors, ArgumentContainer arguments, params Type[] registeredTypes) { var selector = new LightCore.Activation.Components.ConstructorSelector(); var resolutionContext = new LightCore.Activation.ResolutionContext( null, RegistrationHelper.GetRegistrationContainerFor(registeredTypes), arguments, new ArgumentContainer()); return selector .SelectConstructor(constructors, resolutionContext); }
private ConstructorInfo Select(IEnumerable <ConstructorInfo> constructors, ArgumentContainer arguments, params Type[] registeredTypes) { var selector = new LightCore.Activation.Components.ConstructorSelector(); var resolutionContext = new ResolutionContext( null, RegistrationHelper.GetRegistrationContainerFor(registeredTypes), arguments, new ArgumentContainer()); return(selector .SelectConstructor(constructors, resolutionContext)); }