public void ItShouldFactorAClassWithoutAPublicConstructor()
        {
            // Act
            ClassWithoutAPublicConstructor actual = GetService <ClassWithoutAPublicConstructor>();

            // Assert
            actual
            .Should()
            .NotBeNull()
            .And.BeSameAs(ExpectedNoPublicConstructor);
        }
        public WhenFactoringClassesWithInvalidConstructorsWithoutAContext(ITestOutputHelper output)
        {
            ExpectedNoPublicConstructor        = ClassWithoutAPublicConstructor.Create();
            ExpectedMultiplePublicConstructors = new ClassWithMultiplePublicConstructors();

            _container =
                new RegistrationSetup()
                .RegisterFactory(() => ExpectedNoPublicConstructor)
                .RegisterFactory(() => ExpectedMultiplePublicConstructors)
                .Construct(GetType().GetTypeInfo().Assembly, out string code);

            output.WriteLine(code);
        }
Example #3
0
 public ClassWithMultiplePublicConstructors(ClassWithoutAPublicConstructor other)
 {
     Other = other;
 }
Example #4
0
 public ClassWithMultiplePublicConstructors()
     : this(ClassWithoutAPublicConstructor.Create())
 {
 }