Mocking 'System.Console' behaviour

前端 未结 5 1924
南方客
南方客 2020-12-06 04:45

Is there a standard way of making a C# console application unit-testable by programming against an interface, rather than System.Console?

For example, using an ICons

5条回答
  •  爱一瞬间的悲伤
    2020-12-06 05:26

    I recommend using moles.

    Mainly because I prefer letting your design determine your interfaces and classes, rather than your testing.

提交回复
热议问题