Example #1
0
        /// <summary>
        /// Handle the a test is complete event
        /// </summary>
        private void runner_TestComplete(object sender, TestCompleteEventArgs args)
        {
            WriteToTestPane(args.RawResult, true);
            if (args.Result != null && args.Result.Location != null)
            {// Only UnitTests have a result.
                // Trim off the parens if they exist, the will for Theory
                string location = args.Result.Location.EndsWith(")") == false ?
                                  args.Result.Location :
                                  args.Result.Location.Substring(0, args.Result.Location.LastIndexOf('('));

                UnitTestDetail testData = _Tests.Find(test => test.Method.RootNamespaceLocation == location);
                if (testData == null)
                {
                    testData = new UnitTestDetail(args.Result.Location, testActions);
                    if (testData.Method != null)
                    {// Don't lest bad data in
                        _Tests.Add(testData);
                    }
                }
                testData.Result = args.Result;
            }
        }
		/// <summary>
        /// Handle the a test is complete event
        /// </summary>
        private void runner_TestComplete(object sender, TestCompleteEventArgs args)
        {
            WriteToTestPane(args.RawResult, true);
            if (args.Result != null && args.Result.Location != null)
            {// Only UnitTests have a result.
				// Trim off the parens if they exist, the will for Theory
				string location = args.Result.Location.EndsWith(")") == false ? 
                                      args.Result.Location : 
                                      args.Result.Location.Substring(0, args.Result.Location.LastIndexOf('(')) ;

                UnitTestDetail testData = _Tests.Find(test => test.Method.RootNamespaceLocation == location);
                if (testData == null)
                {
                    testData = new UnitTestDetail(args.Result.Location, testActions);
                    if (testData.Method != null)
                    {// Don't lest bad data in
                        _Tests.Add(testData);
                    }
                }
                testData.Result = args.Result;
            }
        }