gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-05 00:44:03 24 4
gpt4 key购买 nike

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

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com