コード例 #1
0
        /// <summary>
        /// Creates the execution logic
        /// </summary>
        /// <remarks>
        /// See summary.
        /// </remarks>
        /// <returns>A <see cref="IRun"/> instance that represent the type
        /// test logic.
        /// </returns>
        public override IRun GetRun()
        {
            SequenceRun runs = new SequenceRun();

            // add setup
            CustomRun setup = new CustomRun(
                this.fixtureType,
                typeof(SetUpAttribute),
                true                 // it is a test
                );

            setup.FeedSender = false;
            runs.Runs.Add(setup);

            // fixture class provider
            FixtureDecoratorRun providerFactory = new FixtureDecoratorRun(
                typeof(ProviderFixtureDecoratorPatternAttribute)
                );

            runs.Runs.Add(providerFactory);

            // add tester for the order
            CustomRun test = new CustomRun(
                this.fixtureType,
                typeof(TestAttribute),
                true                 // it is a test
                );

            test.FeedSender = false;
            runs.Runs.Add(test);


            // add tear down
            CustomRun tearDown = new CustomRun(
                this.fixtureType,
                typeof(TearDownAttribute),
                true                 // it is a test
                );

            tearDown.FeedSender = false;
            runs.Runs.Add(tearDown);

            return(runs);
        }
コード例 #2
0
        /// <summary>
        /// Gets the test runner class defining all the tests to be run and the test logic to be used within the tagged fixture class.
        /// </summary>
        /// <returns>A <see cref="SequenceRun"/> object</returns>
        public override IRun GetRun()
        {
            SequenceRun runs = new SequenceRun();

            // creating parallel
            ParallelRun para = new ParallelRun();

            para.AllowEmpty = false;
            runs.Runs.Add(para);

            // method providers
            MethodRun provider = new MethodRun(
                typeof(ProviderAttribute),
                typeof(ArgumentFeederRunInvoker),
                false,
                true
                );

            para.Runs.Add(provider);

            // fixture class provider
            FixtureDecoratorRun providerFactory = new FixtureDecoratorRun(
                typeof(ProviderFixtureDecoratorPatternAttribute)
                );

            para.Runs.Add(providerFactory);

            // setup
            OptionalMethodRun setup = new OptionalMethodRun(typeof(SetUpAttribute), false);

            runs.Runs.Add(setup);

            // tests
            MethodRun test = new MethodRun(typeof(TestPatternAttribute), true, true);

            runs.Runs.Add(test);

            // tear down
            OptionalMethodRun tearDown = new OptionalMethodRun(typeof(TearDownAttribute), false);

            runs.Runs.Add(tearDown);

            return(runs);
        }