有没有一种标准方法可以通过对接口而不是System.Console进行编程来使C#控制台应用程序单元可测试?
例如,使用IConsole界面?
你做过这个,你用过什么样的方法?
您是否公开了应用程序需要写入标准输出的事件?
c# console unit-testing interface inversion-of-control
c# ×1
console ×1
interface ×1
inversion-of-control ×1
unit-testing ×1