当使用"Azure应用程序(预览)“模板在默认/空白的IntelliTest应用程序上运行ASP.net时,IntelliTest找不到任何需要测试的东西。我不确定这是由设计,一个bug,还是只是还不支持。有人知道解决办法吗?
IntelliTest输出窗口显示“已退出的监视进程找不到要运行的任何测试(-1013-0xfffffc0b)”。我已经确定该项目的目标是x86。
如果我使用"Web“模板,IntelliTest将正确地生成测试结果(在下面的步骤4中,选择Web而不是Azure )。我现在已经在两台机器上验证了上述行为。
复制:


发布于 2015-11-03 11:42:43
最后,将这个问题归结为Swashbuckle和intelliTest之间的一些不兼容( api应用程序使用Swasbuckle来为API生成Swagger )。
要解决这个问题,请在App项目的SwaggerConfig.cs文件夹中打开App_Start,并删除从IOperationFilter继承的以下类。这样做的缺点是在“傲慢的文档”中没有将您的params连接在一起,这一点我还是不太喜欢(默认模型更好地从其中读取一长串参数)。
internal class IncludeParameterNamesInOperationIdFilter : IOperationFilter
{
public void Apply(Operation operation, SchemaRegistry schemaRegistry, ApiDescription apiDescription)
{
if (operation.parameters != null)
{
// Select the capitalized parameter names
var parameters = operation.parameters.Select(
p => CultureInfo.InvariantCulture.TextInfo.ToTitleCase(p.name));
// Set the operation id to match the format "OperationByParam1AndParam2"
operation.operationId = $"{operation.operationId}By{string.Join("And", parameters)}";
}
}
}https://stackoverflow.com/questions/33151749
复制相似问题