Replace Console.WriteLine in NUnit

前端 未结 5 1904
野趣味
野趣味 2020-12-14 14:56

I haven\'t done much with NUnit before, but I just wanted to dump some text to a window in a console type fashion.

e.g. Console.WriteLine("... some infor         


        
5条回答
  •  遥遥无期
    2020-12-14 15:39

    Use the Test-Output view.

    Steps:

    1. Open Test Explorer
    2. Select any particular test
    3. Run it if it has never been run.
    4. Click on the output link on the test results pane.

    There is isn't any need to replace Console.WriteLine with anything as this view logs messages from:

    Console.WriteLine

    Trace.WriteLine

    Debug.WriteLine

    TestExplorer.Out.WriteLine

提交回复
热议问题