Esempio n. 1
0
        public void duplicated_runs_dont_accidentally_accumulate_afterEach_calls()
        {
            AFixture fixture = new AFixture();

            var fakeGlobalSetupManager = new FakeGlobalSetupManager();

            TestPosition testPosition = TestPosition.At(1, 3, 2);

            var traceMessages = new List <string>();

            SpecificationRunner.RunTest(new TestContext()
            {
                FixtureContext = new FixtureContext(null, () => fixture, null, fakeGlobalSetupManager),
                Name           = new TestName(),
                Position       = testPosition
            }, traceMessages);

            fixture.ResetObservations();

            var traceMessages1 = new List <string>();

            SpecificationRunner.RunTest(new TestContext()
            {
                FixtureContext = new FixtureContext(null, () => fixture, null, fakeGlobalSetupManager),
                Name           = new TestName(),
                Position       = testPosition
            }, traceMessages1);

            expect_observation_matches(fixture.Observations, 1, 2, 3, 4, 5, 6, -2, -3, -4, 7, 8);
        }
Esempio n. 2
0
        public void can_be_ran()
        {
            AFixture fixture = new AFixture();

            var fakeGlobalSetupManager = new FakeGlobalSetupManager();

            var traceMessages = new List <string>();

            SpecificationRunner.RunTest(new TestContext()
            {
                FixtureContext = new FixtureContext(null, () => fixture, null, fakeGlobalSetupManager),
                Name           = new TestName(),
                Position       = TestPosition.At(1, 3, 2)
            }, traceMessages);

            expect_observation_matches(fixture.Observations, 1, 2, 3, 4, 5, 6, 7, -2, -3, -4, 8);
        }