예제 #1
0
        public void ShouldAllowRandomShufflingOfCaseExecutionOrder()
        {
            var listener = new StubListener();
            var convention = new SelfTestConvention();

            convention.ClassExecution
                      .CreateInstancePerTestClass()
                      .ShuffleCases(new Random(1));

            convention.Execute(listener, typeof(SampleIrrelevantClass), typeof(PassTestClass), typeof(int), typeof(PassFailTestClass), typeof(SkipTestClass));

            listener.Entries.ShouldEqual("Fixie.Tests.Conventions.ConventionTests+PassTestClass.PassB passed.",
                                         "Fixie.Tests.Conventions.ConventionTests+PassTestClass.PassA passed.",
                                         "Fixie.Tests.Conventions.ConventionTests+PassFailTestClass.Fail failed: 'Fail' failed!",
                                         "Fixie.Tests.Conventions.ConventionTests+PassFailTestClass.Pass passed.",
                                         "Fixie.Tests.Conventions.ConventionTests+SkipTestClass.Skip skipped.");
        }
예제 #2
0
        public void ShouldExecuteAllCasesInAllDiscoveredTestClasses()
        {
            var listener = new StubListener();
            var convention = new SelfTestConvention();

            convention.Execute(listener, typeof(SampleIrrelevantClass), typeof(PassTestClass), typeof(int), typeof(PassFailTestClass), typeof(SkipTestClass));

            listener.Entries.ShouldEqual("Fixie.Tests.Conventions.ConventionTests+PassTestClass.PassA passed.",
                                         "Fixie.Tests.Conventions.ConventionTests+PassTestClass.PassB passed.",
                                         "Fixie.Tests.Conventions.ConventionTests+PassFailTestClass.Fail failed: 'Fail' failed!",
                                         "Fixie.Tests.Conventions.ConventionTests+PassFailTestClass.Pass passed.",
                                         "Fixie.Tests.Conventions.ConventionTests+SkipTestClass.Skip skipped.");
        }