.net - 如何对 winforms 应用程序进行单元测试

标签 .net winforms unit-testing

多亏了 ASP.NET MVC 框架,才有可能对 Web 应用程序进行单元测试。但是,您如何对 Windows 窗体应用程序进行单元测试?

最佳答案

一种方法是为 Winforms 应用程序使用模型 View 演示者 (MVP) 模式。如果您已经使用过 MVC,则很容易适应

Specifically, take the view part of MVC and slice it as thin as possible so that it is only a skin around the actual UI components and make it completely passive. The controller, now called the "presenter," is responsible for all interaction with the rest of the system.



阅读一些很棒的文章。

Dan Bunea - Click to read

Jeremy Miller - Click to read

快乐编码

关于.net - 如何对 winforms 应用程序进行单元测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/397386/

相关文章:

.net - 当我的代码没有出现在堆栈中时,如何调试此错误?

.net - 我可以避免在调试器附带调试器的情况下避免缓慢的.net异常吗?

.net - .NET 的正则表达式图灵完整吗?

java - 以编程方式实例化具有 Spring 生命周期注释的类的对象

c# - .NET 中是否有 "Void"结构的实际用途

c# - 在 C# 中的标签中显示全文

winforms - 双击选项卡控件标题

c# - 值更改时触发事件 C#

unit-testing - 当测试文件和被测文件位于不同文件夹时如何设置.cabal测试套件

java - 在没有显式测试套件类声明的情况下清理所有 JUnit 测试