I'm using VS2008 Team Suite, ASP.NET MVC Beta, with TestDriven.Net installed. When I created my project from the template, it created a "Tests" project as well and put some controller tests for the AccountController in a folder inside this project. I've added other controllers and associated tests. Howerver, when I right-click on a method in a controller and use the "Create Unit Tests" dialog it fails to create the unit test stub in my existing test class in the project. It creates a new test class file with the same name at the root of the test project, but doesn't insert the test stub. If I move the controller tests up one level from the controllers folder in the test project it works fine.
我正在使用安装了TestDriven.Net的VS2008 Team Suite,ASP.NET MVC Beta。当我从模板创建项目时,它也创建了一个“测试”项目,并将AccountController的一些控制器测试放在该项目内的一个文件夹中。我添加了其他控制器和相关测试。 Howerver,当我右键单击控制器中的方法并使用“创建单元测试”对话框时,它无法在项目的现有测试类中创建单元测试存根。它在测试项目的根目录下创建一个具有相同名称的新测试类文件,但不插入测试存根。如果我将控制器测试从测试项目中的controllers文件夹向上移动一级,则可以正常工作。
Does anyone else see this behavior or is it something related to my particular set up? I wouldn't have noticed, but the project segregated the tests in a separate folder, which I thought was a good idea. Now that I'm trying to use it, I either have to create new tests by hand or undo the segregation. If it's just me, any ideas on where to adjust the behavior to fix it?
有没有其他人看到这种行为或是否与我的特定设置有关?我不会注意到,但项目将测试隔离在一个单独的文件夹中,我认为这是一个好主意。既然我正在尝试使用它,我要么必须手动创建新的测试,要么撤消隔离。如果只是我,任何关于在哪里调整行为来修复它的想法?
I have Visual C# test project
selected as default in options, with Unit Test
as the only file included.
我在选项中选择了默认的Visual C#测试项目,单元测试是唯一包含的文件。
2 个解决方案
#1
0
I've just tried doing this with a controller that I had already created. The controller unit test class was created in the root of the (test) project. When I created a test for another action on the class a second test was created in the same class.
我刚试过用我已经创建的控制器做这个。控制器单元测试类是在(测试)项目的根目录中创建的。当我在类上为另一个动作创建测试时,在同一个类中创建了第二个测试。
I'm not seeing the separate folders, this test class was created in the root of the test project.
我没有看到单独的文件夹,这个测试类是在测试项目的根目录中创建的。
Sorry this wasn't more helpful.
对不起,这没什么用处。
#2
0
Submitted as a bug on Codeplex.
在Codeplex上提交为错误。
#1
0
I've just tried doing this with a controller that I had already created. The controller unit test class was created in the root of the (test) project. When I created a test for another action on the class a second test was created in the same class.
我刚试过用我已经创建的控制器做这个。控制器单元测试类是在(测试)项目的根目录中创建的。当我在类上为另一个动作创建测试时,在同一个类中创建了第二个测试。
I'm not seeing the separate folders, this test class was created in the root of the test project.
我没有看到单独的文件夹,这个测试类是在测试项目的根目录中创建的。
Sorry this wasn't more helpful.
对不起,这没什么用处。
#2
0
Submitted as a bug on Codeplex.
在Codeplex上提交为错误。