public static void Initialization(ExampleFixture fixture) { "Given a test fixture" .x(() => fixture = new ExampleFixture()); "When I initialize the fixture" .x(() => Fake.InitializeFixture(fixture)); "Then the sut is set" .x(() => fixture.Sut.Should().NotBeNull()); "And dependencies are injected into the sut from the fixture" .x(() => fixture.Sut.Foo.Should().BeSameAs(fixture.Foo)); "And dependencies are injected into the sut even when not available in fixture" .x(() => fixture.Sut.ServiceProvider.Should().NotBeNull()); "And dependencies of the same type are the same instance" .x(() => fixture.Sut.Foo.Should().BeSameAs(fixture.Sut.Foo2)); "And public attributed fixture fields are set" .x(() => fixture.FooField.Should().NotBeNull()); "And public unattributed fixture fields are not set" .x(() => fixture.UnattributedFooField.Should().BeNull()); "And private attributed fixture properties are set" .x(() => typeof(ExampleFixture).GetProperty("PrivateFoo", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(fixture).Should().NotBeNull()); "And private attributed fixture fields are set" .x(() => typeof(ExampleFixture).GetField("privateFoo", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(fixture).Should().NotBeNull()); "And public unattributed fixture properties are not set" .x(() => fixture.UnattributedFoo.Should().BeNull()); }
public static void Initialization(ExampleFixture fixture) { "given a test fixture" .x(() => fixture = new ExampleFixture()); "when the fixture is initialized" .x(() => Fake.InitializeFixture(fixture)); "then the sut should be set" .x(() => fixture.Sut.Should().NotBeNull()); "and dependencies should be injected into the sut from the fixture" .x(() => fixture.Sut.Foo.Should().BeSameAs(fixture.Foo)); "and dependencies should be injected into the sut even when not available in fixture" .x(() => fixture.Sut.ServiceProvider.Should().NotBeNull()); "and dependencies of the same type should be the same instance" .x(() => fixture.Sut.Foo.Should().BeSameAs(fixture.Sut.Foo2)); }
public static void Initialization() { "establish" .x(() => Fixture = new ExampleFixture()); "when initializing fixture" .x(() => Fake.InitializeFixture(Fixture)); "it should set sut" .x(() => Fixture.Sut.Should().NotBeNull()); "it should use the same instance when more than one dependency is of the same type" .x(() => Fixture.Sut.Foo.Should().BeSameAs(Fixture.Sut.Foo2)); "it should inject fake from fixture" .x(() => Fixture.Sut.Foo.Should().BeSameAs(Fixture.Foo)); "it should inject fake when not available in fixture" .x(() => Fixture.Sut.ServiceProvider.Should().NotBeNull()); }
public AuthoriseByRelatedTests(ExampleFixture <AuthoriseByRelatedTests> fixture) { HttpClient = fixture.HttpClient; }
public SettersTests(ExampleFixture <SettersTests> fixture) { HttpClient = fixture.HttpClient; }
public HomeDirectoryTests(ExampleFixture <HomeDirectoryTests> fixture) { HttpClient = fixture.HttpClient; }
public IdentifierTests(ExampleFixture <IdentifierTests> fixture) { HttpClient = fixture.HttpClient; }
public AutoMapTests(ExampleFixture <AutoMapTests> fixture) { HttpClient = fixture.HttpClient; }
public GettersAndQueryTests(ExampleFixture <GettersAndQueryTests> fixture) { HttpClient = fixture.HttpClient; }
public SubstemTests(ExampleFixture <SubstemTests> fixture) { HttpClient = fixture.HttpClient; }
public ComplexFieldGettersTests(ExampleFixture <ComplexFieldGettersTests> fixture) { HttpClient = fixture.HttpClient; }