简体   繁体   English

如何告诉IntelliTest在哪个项目中存储生成的测试?

[英]How to Tell IntelliTest which Project to Store Generated Tests In?

I have a sample project for which I wish to use IntelliTests. 我有一个示例项目,希望使用IntelliTests。 Though I've created a project to house the generated tests, IntelliTest seems to ignore it and create a new project with another testing framework and settings. 尽管我已经创建了一个项目来容纳生成的测试,但是IntelliTest似乎忽略了它,并使用另一个测试框架和设置创建了一个新项目。 Is there a way to tell IntelliTest which project to use? 有没有办法告诉IntelliTest使用哪个项目?

Here are the steps I've taken: 这是我已采取的步骤:

In my project there is one class with a single method. 在我的项目中,只有一个类具有一个方法。 I have first right clicked within the method and selected Create IntelliTest from the context menu. 我首先右键单击该方法,然后从上下文菜单中选择“ Create IntelliTest ”。 Then I've create a test project using these settings: 然后,使用以下设置创建一个测试项目:

在此处输入图片说明

I've now right click within the method again, and selected Run IntelliTest from the context menu. 现在,我再次右键单击该方法,然后从上下文菜单中选择Run IntelliTest ”。 After the tests have been generated, I select all of them, and click on the save icon. 生成测试后,选择所有测试,然后单击save图标。 IntelliTest now wrongly creates an new project with VS tests. IntelliTest现在错误地使用VS测试创建了一个新项目。 It complete ignores the previous project created as well as all the setting (see picture). 它完全忽略了先前创建的项目以及所有设置(参见图片)。

When you ran Create IntelliTest on your product code, you would have noticed a test project with a .cs file and a parameterized unit test within it (look for the method decorated with [PexMethod]. Do a “Run IntelliTest” on that method and IntelliTest will know to save the resultant tests into that project. 在产品代码上运行“创建IntelliTest”时,您会注意到其中包含.cs文件和参数化单元测试的测试项目(查找用[PexMethod]装饰的方法。对该方法执行“运行IntelliTest”,然后IntelliTest将知道将结果测试保存到该项目中。

In the workflow you describe, you do “Run IntelliTest” on product code again. 在您描述的工作流程中,您再次对产品代码执行“运行IntelliTest”。 That is treated as a fresh exploration. 那被视为新的探索。

Please see here for some context: https://blogs.msdn.microsoft.com/visualstudioalm/2015/07/25/unit-test-generators-extensibility-hats-off-to-our-community/ 请在此处查看某些上下文: https : //blogs.msdn.microsoft.com/visualstudioalm/2015/07/25/unit-test-generators-extensibility-hats-off-to-our-community/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM