public void ItShouldCreateTheService() { // Act SimpleClass1WithoutDependencies actual = GetService <SimpleClass1WithoutDependencies>(); // Assert actual.Should().NotBeNull(); }
public void ItShouldCreateTheServiceUsingTheGivenFactory() { // Act SimpleClass1WithoutDependencies actual = GetService <SimpleClass1WithoutDependencies>(); // Assert actual .Should() .NotBeNull() .And.BeSameAs(Expected); }
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); }
public ClassWithAnInternalAndPublicConstructor(SimpleClass1WithoutDependencies other) { Other = other; }
public ClassWithAPrivateAndPublicConstructor(SimpleClass1WithoutDependencies other) { Other = other; }