How can I write output from a unit test?

后端 未结 15 985
误落风尘
误落风尘 2020-11-28 20:56

Any call in my unit tests to either Debug.Write(line) or Console.Write(Line) simply gets skipped over while debugging and the output is never print

15条回答
  •  星月不相逢
    2020-11-28 21:58

    In Visual Studio 2017, you can see the output from test explorer.

    1) In your test method, Console.WriteLine("something");

    2) Run the test.

    3) In Test Explorer window, click the Passed Test Method.

    4) And click the "Output" link.

    And click "Output", you can see the result of Console.Writeline().

提交回复
热议问题