When running IntelliTest on a default/blank ASP.net application using the "Azure API App (Preview)" template, IntelliTest finds nothing to test. I am not sure if this is by design, a bug, or just not supported yet. Does anyone know a workaround?
The IntelliTest output window displays "monitored process exited with could not find any test to run (-1013 - 0xfffffc0b)". I have made sure the project targets x86.
If I use the "Web API" template, IntelliTest correctly produces test results (in step 4 below choose Web API instead of Azure API App). I have now verified the above behaviour on 2 machines.
To replicate:
Eventually tracked this problem down to some incompatibility between Swashbuckle and intelliTest (Swasbuckle is used by api apps to generate Swagger doc for the API).
To solve, open SwaggerConfig.cs in your App_Start folder of your API App project and remove the below class that inherits from IOperationFilter. The disadvantage of this is not having your params joined together in the swagger doc, something I do not like much anyway (the default model is much nicer to read a long list of params from).
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)}";
}
}
}