Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7047507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:46:47+00:00 2026-05-28T02:46:47+00:00

I am running NUnit tests using RemoteTestRunner . In the end, I get a

  • 0

I am running NUnit tests using RemoteTestRunner. In the end, I get a TestResult object containing the results. The unit test project compiles as a console application.
The problem is, after running the tests, the output gets somehow redirected, and I can’t print the results to the console.

Here’s the code. It doesn’t output anything, not even "Open, sesame!" (although it does run to the end – confirmed in the debugger).

Any suggestions?

Also, is there a built-in way to list the failed results, given the TestResults instance?

public static void Main()
{
    TestPackage testPackage = new TestPackage(AssemblyPath);
    RemoteTestRunner remoteTestRunner = new RemoteTestRunner();
    remoteTestRunner.Load(testPackage);
    TestResult testResult = remoteTestRunner.Run(null);

    Console.WriteLine(testResult.IsFailure);

    Console.WriteLine("Open, sesame!");

}
public static string AssemblyPath
{
    get
    {
        string codeBase = Assembly.GetExecutingAssembly().CodeBase;
        UriBuilder uri = new UriBuilder(codeBase);
        string path = Uri.UnescapeDataString(uri.Path);
        return path;
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T02:46:48+00:00Added an answer on May 28, 2026 at 2:46 am

    Try to store the current output stream of the Console before running the tests with

    var currentOut = Console.Out;
    

    Then setting it back once the run has been performed with

    Console.SetOut(currentOut);
    

    Also, is there a built-in way to list the failed results given the TestResults instance?

    I haven’t been able to find any. However, the following piece of code should provide you with some help. It recursively introspects the composed TestResult structure and outputs the result of each test to the console.

    static void OutputResult(TestResult result)
    {
        if(result.HasResults)
        {
            foreach (var childResult in result.Results)
            {
                OutputResult((TestResult)childResult);
            }
            return;
        }
    
        Console.WriteLine("{0}:{1}", result.FullName, result.ResultState);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using WatiN, NUnit and ReSharper to run my ASP.NET unit tests inside Visual
I'm running some NHibernate tests with NUnit and the NUnit test agent is crashing.
We have a CruiseControl server running various AntUnit, MbUnit and NUnit tests via Ant.
I'm running a NUnit test over a list of numbers. My code goes something
I am using pnunit to run nunit tests on remote machines, the pnunit agent
Summary: I can run unit tests and code-coverage, but the report only includes NUnit
I want to get the console output along with the regular test results in
I'm trying to run Watin from within a TeamCity build, using nUnit. All tests
I've got several unit tests written with NUnit that are calling selenium commands. I've
I am getting the following Warnings while running tests using cc.net c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets (,): warning

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.