Exemplo n.º 1
0
		/// <summary>
		/// Protected constructor constructs a test result given
		/// a test and a name.
		/// </summary>
		/// <param name="test">The test to be used</param>
		/// <param name="name">Name for this result</param>
		protected TestResult(TestInfo test, string name)
		{
			this.name = name;
			this.test = test;
            this.RunState = RunState.Runnable;
            if (test != null)
            {
                this.description = test.Description;
                this.runState = test.RunState;
                this.messageString = test.IgnoreReason;
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Construct a test result given a TestInfo
 /// </summary>
 /// <param name="test">The test to be used</param>
 public TestResult(TestInfo test)
 {
     this.test = test;
     this.message = test.IgnoreReason;
 }
Exemplo n.º 3
0
		/// <summary>
		/// Construct a TestNode given a test
		/// </summary>
		public TestSuiteTreeNode( TestInfo test ) : base(test.TestName.Name)
		{
			this.test = test;
			UpdateImageIndex();
		}
Exemplo n.º 4
0
        public bool Run(TestInfo test, TestSuiteResult suite_result, string test_name, EventListener listener, ITestFilter filter, int timeout)
        {
            listener = new ProxyListener (listener);

            TestRunnerDelegate runner = new TestRunnerDelegate (delegate {
                return server.Run (test_name, listener, filter);
            });

            IAsyncResult ar = runner.BeginInvoke (test_name, null, filter, null, null);

            if (!ar.AsyncWaitHandle.WaitOne (timeout) || !ar.IsCompleted) {
                TestCaseResult error = new TestCaseResult (test);
                string msg = String.Format ("Timeout after {0} ms", timeout);
                error.Failure (msg, null, FailureSite.Parent);
                suite_result.AddResult (error);
                return false;
            }

            try {
                TestResult result = runner.EndInvoke (ar);
                if (result != null) {
                    suite_result.AddResult (result);
                    return true;
                }

                TestCaseResult error = new TestCaseResult (test);
                error.Failure ("Unknown error", null, FailureSite.Parent);
                suite_result.AddResult (error);
                return false;
            } catch (Exception ex) {
                TestCaseResult error = new TestCaseResult (test);
                string msg = String.Format ("Unknown exception: {0}", ex);
                error.Failure (msg, null, FailureSite.Parent);
                suite_result.AddResult (error);
                return false;
            }
        }
        /// <summary>
        /// Construct a result for a test case
        /// </summary>
        /// <param name="testCase">The test case for which this is a result</param>
		public TestCaseResult(TestInfo testCase)
			: base(testCase, testCase.TestName.FullName) { }
		/// <summary>
		/// Construct a TestSuiteResult from a test and a name
		/// </summary>
		/// <param name="test"></param>
		/// <param name="name"></param>
		public TestSuiteResult(TestInfo test, string name) 
			: base(test, name) { }
 /// <summary>
 /// Construct a result for a test case
 /// </summary>
 /// <param name="testCase">The test case for which this is a result</param>
 public TestCaseResult(TestInfo testCase)
     : base(testCase, testCase.TestName.FullName)
 {
 }
Exemplo n.º 8
0
 /// <summary>
 /// Construct a TestSuiteResult from a test and a name
 /// </summary>
 /// <param name="test"></param>
 /// <param name="name"></param>
 public TestSuiteResult(TestInfo test, string name)
     : base(test, name)
 {
 }
Exemplo n.º 9
0
 /// <summary>
 /// Construct a test result given a TestInfo
 /// </summary>
 /// <param name="test">The test to be used</param>
 public TestResult(TestInfo test)
 {
     this.test    = test;
     this.message = test.IgnoreReason;
 }
Exemplo n.º 10
0
 public FakeTestResult(TestInfo test)
     : base(test)
 {
 }
Exemplo n.º 11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TestUnit"/> class.
 /// </summary>
 /// <param name="test"></param>
 /// <param name="testRun">The test run.</param>
 /// <param name="assemblyName">Name of the assembly.</param>
 public TestUnit(ITest test, TestRun testRun, string assemblyName)
 {
     Run = testRun;
     AssemblyName = assemblyName;
     Info = new TestInfo(test);
 }