多亏了 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/