static SampleRunner Run <T>()
        {
            Assembly     assembly = typeof(T).Assembly;
            SampleRunner runner;

            if (!_runners.TryGetValue(assembly, out runner))
            {
                runner = new SampleRunner();
                runner.AddAssembly(assembly);

                if (runner.TestPackage.Files.Count != 0)
                {
                    runner.Run();
                }

                _runners.Add(assembly, runner);
            }

            return(runner);
        }
        public void RunDeclaredSamples()
        {
            if (isSampleRunning)
            {
                return;
            }

            try
            {
                isSampleRunning = true;
                ConfigureRunner();

                if (runner.TestPackage.Files.Count != 0)
                {
                    runner.Run();
                }
            }
            finally
            {
                isSampleRunning = false;
            }
        }
Ejemplo n.º 3
0
        public void RunDeclaredSamples()
        {
            // Protect the sample runner from re-entrance when we are asked to run
            // samples that are defined in nested classes of the fixture.
            if (isSampleRunning)
            {
                return;
            }

            try
            {
                isSampleRunning = true;
                ConfigureRunner();

                if (runner.TestPackage.Files.Count != 0)
                {
                    runner.Run();
                }
            }
            finally
            {
                isSampleRunning = false;
            }
        }
Ejemplo n.º 4
0
 public void SetUp()
 {
     sampleRunner = new SampleRunner();
     sampleRunner.AddFixture(typeof(TSample));
     sampleRunner.Run();
 }