无法将新存根添加到现有的单元测试项目中 [英] unable to add new stubs to an existing unit test project

查看:75
本文介绍了无法将新存根添加到现有的单元测试项目中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在VS中

In VS

1.使用其中一个公共方法的上下文菜单创建参数化单元测试 - 创建一个新项目

1.create a parameterized unit test by using the context menu on one of the public methods – a new project is created

2。右键单击要测试的项目并选择"创建参数化单元" - 对话框出现

2. right click the project under test and select ‘create a parameterized unit’ – dialog comes up

问题1:pex尝试创建一个新的单元测试项目,并且不重用已经构建的存根的现有单元测试项目

Problem 1: pex attempts to create a new unit testing project and does not reuse the existing one with the stubs already built

问题2:尝试重命名后取消按钮在对话框上不起作用输出项目到现有项目(需要点击x)

Problem 2:cancel button does not work on the dialog after you attempt to rename the output project to an existing project (need to click the x)

推荐答案

问题(1)目前是设计的,因为参数化单元测试生成器不支持增量生成测试。换句话说,我们会生成重复的参数化单元测试,这些测试最终会变得一团糟。

将来,我们将挖掘现有的测试套件并仅针对不具备该方法的方法生成参数化单元测试有任何PexMethod。这可能不会在下一个版本中发生。
The problem (1) is currently by design because the parameterized unit test generator does not support incremental generation of tests yet. In other words, we would generate duplicate parameterized unit tests which would end up in a mess.

In the future, we will mine the existing test suite and generate parameterized unit tests only for the method that do not have any PexMethod. This will probably not happen by the next release.


这篇关于无法将新存根添加到现有的单元测试项目中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆