How can I add log messages to an NUnit test that will appear in a nant build execution?

前端 未结 1 871
广开言路
广开言路 2021-02-11 17:35

With NUnit, if you add Debug.Print statements in your tests they appear in the test output. (At least they do in the ReSharper unit test window.)

When using a NAnt build

相关标签:
1条回答
  • 2021-02-11 18:29

    Console.WriteLine() should be preserved (it is for my version of NUnit at least).

    That said, consider - each time you want to add some text output - how you could turn it into an assertion with a message. Your tests will get much better.

    0 讨论(0)
提交回复
热议问题