Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个包含数百个类的现有程序集。我想一次针对一个班级运行 Pex,但我想不出办法。在这方面的任何帮助将不胜感激......
当我想要执行此操作时,我倾向于使用 Visual Studio 测试工具中内置的单元测试向导为我创建特定类和方法的测试。(测试->新建测试->选择单元测试向导)
所有测试类都是具有 [TestClass] 属性的类...如果您想要 pex 类,只需添加 [PexClass] 属性。
然后,您使用 [PexMethod] 属性添加参数化单元测试,它将为您生成带有 [TestMethod] 属性的测试。