/// <summary>
        /// </summary>		
        public override IRun GetRun()
        {
            SequenceRun runs = new SequenceRun();

            // set up
            OptionalMethodRun setup = new OptionalMethodRun(typeof(SetUpAttribute),false);
            runs.Runs.Add( setup );

            // create data
            MethodRun dataProvider = new MethodRun(
                                               typeof(DataProviderAttribute),
                                               typeof(ArgumentFeederRunInvoker),
                                               false,
                                               true
                                               );
            runs.Runs.Add(dataProvider);

            // collection providers	for collection
            MethodRun copyTo = new MethodRun(
                                               typeof(CopyToProviderAttribute),
                                               typeof(ArgumentFeederRunInvoker),
                                               false,
                                               true
                                               );
            runs.Runs.Add(copyTo);

            // add tester for the order
            CustomRun test = new CustomRun(
                typeof(EnumerationTester),
                typeof(TestAttribute),
                true // it is a test
                );
            runs.Runs.Add(test);

            // tear down
            OptionalMethodRun tearDown = new OptionalMethodRun(typeof(TearDownAttribute),false);
            runs.Runs.Add(tearDown);

            return runs;
        }
Example #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;
        }
        /// <summary>
        /// Creates the run order for the collection
        /// </summary>
        /// <returns>An object derived from <see cref="IRun" /> (a <see cref="SequenceRun" /> object that contains the order of execution</returns>
        public override IRun GetRun() {
            SequenceRun runs = new SequenceRun();

            // set up
            OptionalMethodRun setup = new OptionalMethodRun(typeof(SetUpAttribute), false);
            runs.Runs.Add(setup);

            // collection providers			
            MethodRun provider = new MethodRun(
                                               typeof(ProviderAttribute),
                                               typeof(ArgumentFeederRunInvoker),
                                               false,
                                               true
                                               );
            runs.Runs.Add(provider);


            // fill
            MethodRun fill = new MethodRun(typeof(FillAttribute),
                                           false,
                                           true
                                           );
            runs.Runs.Add(fill);

            // add tester for the order
            CustomRun orderTest = new CustomRun(
                typeof(CollectionOrderTester),
                typeof(TestAttribute),
                true, // it test
                this.order, // constructor arguments
                comparer
                );
            runs.Runs.Add(orderTest);

            // tear down
            OptionalMethodRun tearDown = new OptionalMethodRun(typeof(TearDownAttribute), false);
            runs.Runs.Add(tearDown);


            return runs;
        }