Пример #1
0
        public void ItShouldCreateTheService()
        {
            // Act
            SimpleClass1WithoutDependencies actual = GetService <SimpleClass1WithoutDependencies>();

            // Assert
            actual.Should().NotBeNull();
        }
Пример #2
0
        public void ItShouldCreateTheServiceUsingTheGivenFactory()
        {
            // Act
            SimpleClass1WithoutDependencies actual = GetService <SimpleClass1WithoutDependencies>();

            // Assert
            actual
            .Should()
            .NotBeNull()
            .And.BeSameAs(Expected);
        }
Пример #3
0
        public WhenFactoringASimpleClassWithoutDependenciesWithoutAContext(ITestOutputHelper output)
        {
            // Arrange
            Expected = new SimpleClass1WithoutDependencies();

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

            output.WriteLine(code);
        }
        public WhenFactoringTwoClassThatImplementTheSameInterfaceWithoutAContext(ITestOutputHelper output)
        {
            Expected1 = new SimpleClass1WithoutDependencies();
            Expected2 = new SimpleClass2WithoutDependencies();

            _container =
                new RegistrationSetup()
                .RegisterFactory <ISimpleInterface, SimpleClass1WithoutDependencies>(() => Expected1)
                .RegisterFactory <ISimpleInterface, SimpleClass2WithoutDependencies>(() => Expected2)
                .Construct(GetType().GetTypeInfo().Assembly, out string code);

            output.WriteLine(code);
        }
Пример #5
0
 public ClassWithAnInternalAndPublicConstructor(SimpleClass1WithoutDependencies other)
 {
     Other = other;
 }
Пример #6
0
 public ClassWithAPrivateAndPublicConstructor(SimpleClass1WithoutDependencies other)
 {
     Other = other;
 }