如何使用PexArgument属性将GUID作为Pex参数传递?
发布于 2012-01-13 22:27:45
你不能。从MSDN attributes tutorial
属性参数限制为以下类型的常量值:
您只需从生成的PexMethod中删除Guid参数并硬连接该值:
[PexMethod]
public string MyFunction()
{
Guid guid = Guid.Parse("394865F4-94AB-4B06-B00D-F66CD2CECE7D");
string result = MyClass.MyFunction(guid);
return result;
// TODO: add assertions to method MyClass_Test.MyFunction(Guid)
}https://stackoverflow.com/questions/8802505
复制相似问题