public AutomaticDependencyFactory(ConstructorSelection constructor_selection, Type type_to_create,
                                   DependencyContainer dependency_container)
 {
     this.constructor_selection = constructor_selection;
     this.dependency_container  = dependency_container;
     this.type_to_create        = type_to_create;
 }
 public AutomaticDependencyFactory(ConstructorSelection constructor_selection, Type type_to_create,
                                   DependencyContainer dependency_container)
 {
     this.constructor_selection = constructor_selection;
     this.dependency_container = dependency_container;
     this.type_to_create = type_to_create;
 }
            public void LeastParameters_ShouldCreateWithDefaultConstructorSelection(ConstructorSelection constructorSelection, int expectedConstructorParamsCount)
            {
                // arrange
                var sut = new ConstructorSelector <SomeClass>(constructorSelection);

                // act
                var constructor = sut.SelectConstructor();

                // assert
                constructor.Should().NotBeNull();
                constructor.GetParameters().Should().HaveCount(expectedConstructorParamsCount);
            }
示例#4
0
 public ConstructorSelector(ConstructorSelection constructorSelection = ConstructorSelection.Default)
 {
     ConstructorSelection = constructorSelection;
 }
 public ConstructorInstanceFactory(ConstructorSelection constructorSelection) : this(new ConstructorSelector <T>(constructorSelection))
 {
 }