static void RecurseNameSpaces(ReportNamespace reportNamespace, ITeamCityMessageProvider messageProvider)
		{
			foreach (ReportFixture reportFixture in reportNamespace.Fixtures)
			{
				foreach (ReportRun run in reportFixture.Runs)
				{
					messageProvider.TestStarted(run.Name);

					if (run.Result == ReportRunResult.Ignore || run.Result == ReportRunResult.Skip)
					{
						messageProvider.TestIgnored(run.Name, run.Result.ToString());
					}
					else if (run.Result == ReportRunResult.Failure)
					{
						ExceptionInfo exceptionInfo = GetExceptionInfo(run.Exception);

						messageProvider.TestFailed(run.Name, exceptionInfo);
					}

					if (!string.IsNullOrEmpty(run.ConsoleOut))
					{
						messageProvider.TestOutputStream(run.Name, run.ConsoleOut);
					}
					if (!string.IsNullOrEmpty(run.ConsoleError))
					{
						messageProvider.TestErrorStream(run.Name, run.ConsoleError);
					}

					messageProvider.TestFinished(run.Name, TimeSpan.FromSeconds(run.Duration));
				}
			}

			foreach (ReportNamespace child in reportNamespace.Namespaces)
			{
				RecurseNameSpaces(child, messageProvider);
			}
		}
예제 #2
0
        static void RecurseNameSpaces(ReportNamespace reportNamespace, ITeamCityMessageProvider messageProvider)
        {
            foreach (ReportFixture reportFixture in reportNamespace.Fixtures)
            {
                foreach (ReportRun run in reportFixture.Runs)
                {
                    messageProvider.TestStarted(run.Name);

                    if (run.Result == ReportRunResult.Ignore || run.Result == ReportRunResult.Skip)
                    {
                        messageProvider.TestIgnored(run.Name, run.Result.ToString());
                    }
                    else if (run.Result == ReportRunResult.Failure)
                    {
                        ExceptionInfo exceptionInfo = GetExceptionInfo(run.Exception);

                        messageProvider.TestFailed(run.Name, exceptionInfo);
                    }

                    if (!string.IsNullOrEmpty(run.ConsoleOut))
                    {
                        messageProvider.TestOutputStream(run.Name, run.ConsoleOut);
                    }
                    if (!string.IsNullOrEmpty(run.ConsoleError))
                    {
                        messageProvider.TestErrorStream(run.Name, run.ConsoleError);
                    }

                    messageProvider.TestFinished(run.Name, TimeSpan.FromSeconds(run.Duration));
                }
            }

            foreach (ReportNamespace child in reportNamespace.Namespaces)
            {
                RecurseNameSpaces(child, messageProvider);
            }
        }