コード例 #1
0
        /// <summary>
        /// This method finds the fixture for this class, and checks that there are two
        /// tests returned (one from the <see cref="TestSuiteFixture"/> and the other
        /// from <see cref="TestFixture"/>).
        /// </summary>
        private void Explore()
        {
            FixtureExplorer explorer = new FixtureExplorer( this.GetType().Assembly );
            explorer.Filter = FixtureFilters.Type(this.GetType().FullName);

            explorer.Explore();
            int i = 0;
            foreach (object fixture in explorer.FixtureGraph.Fixtures)
                ++i;
            Assert.AreEqual(2, i);
        }
コード例 #2
0
ファイル: RemoteTestEngine.cs プロジェクト: tmauldin/mb-unit
 public void SetTestAssembly(Assembly testAssembly)
 {
     if (testAssembly == null)
     {
         throw new ArgumentNullException("testAssembly");
     }
     this.testAssembly = testAssembly;
     this.explorer     = new FixtureExplorer(this.testAssembly);
     this.topo         = new TopologicalSortAlgorithm(
         this.Explorer.FixtureGraph.Graph);
 }
コード例 #3
0
ファイル: RemoteTestEngine.cs プロジェクト: tmauldin/mb-unit
 public virtual void Dispose()
 {
     this.explorer      = null;
     this.fixtureRunner = null;
     if (this.resolver != null)
     {
         this.resolver.Dispose();
         this.resolver = null;
     }
     this.report       = null;
     this.testAssembly = null;
 }
コード例 #4
0
ファイル: RemoteTestEngine.cs プロジェクト: timonela/mb-unit
 public virtual void Dispose()
 {
     this.explorer = null;
     this.fixtureRunner = null;
     if (this.resolver != null)
     {
         this.resolver.Dispose();
         this.resolver = null;
     }
     this.report = null;
     this.testAssembly = null;
 }
コード例 #5
0
 public void SetTestAssembly(Assembly testAssembly)
 {
     if (testAssembly == null)
         throw new ArgumentNullException("testAssembly");
     this.testAssembly = testAssembly;
     this.explorer = new FixtureExplorer(this.testAssembly);
     this.topo = new TopologicalSortAlgorithm(
         this.Explorer.FixtureGraph.Graph);
 }
コード例 #6
0
ファイル: FixtureRunnerBase.cs プロジェクト: timonela/mb-unit
        public virtual void Run(
            FixtureExplorer explorer,
            ReportListener reportListener
            )
        {
            if (explorer == null)
                throw new ArgumentNullException("explorer");
            if (reportListener == null)
				throw new ArgumentNullException("reportListener");

            this.explorer = explorer;
            this.report = reportListener;
            this.abortPending = false;

            try
            {
                // start reporting
                this.Report.StartTests();

                if (this.IsAbortPending)
                    return;

                // assembly setup
                if (!this.RunAssemblySetUp())
                    return;

                if (this.IsAbortPending)
                    return;

                try
                {
                    RunFixtures();
                }
                finally
                {
                    this.RunAssemblyTearDown();
                }
            }
            catch (Exception ex)
            {
                ReportException rex = ReportException.FromException(ex);
                ReportExceptionException rexe = new ReportExceptionException(
                    "Internal error while running tests in " + 
                    this.Explorer.AssemblyName, rex);
                throw rexe;
            }
            finally
            {
                this.Report.FinishTests();

                this.explorer = null;
                this.report = null;
            }
        }
コード例 #7
0
ファイル: FixtureRunnerBase.cs プロジェクト: tmauldin/mb-unit
        public virtual void Run(
            FixtureExplorer explorer,
            ReportListener reportListener
            )
        {
            if (explorer == null)
            {
                throw new ArgumentNullException("explorer");
            }
            if (reportListener == null)
            {
                throw new ArgumentNullException("reportListener");
            }

            this.explorer     = explorer;
            this.report       = reportListener;
            this.abortPending = false;

            try
            {
                // start reporting
                this.Report.StartTests();

                if (this.IsAbortPending)
                {
                    return;
                }

                // assembly setup
                if (!this.RunAssemblySetUp())
                {
                    return;
                }

                if (this.IsAbortPending)
                {
                    return;
                }

                try
                {
                    RunFixtures();
                }
                finally
                {
                    this.RunAssemblyTearDown();
                }
            }
            catch (Exception ex)
            {
                ReportException          rex  = ReportException.FromException(ex);
                ReportExceptionException rexe = new ReportExceptionException(
                    "Internal error while running tests in " +
                    this.Explorer.AssemblyName, rex);
                throw rexe;
            }
            finally
            {
                this.Report.FinishTests();

                this.explorer = null;
                this.report   = null;
            }
        }