Method Start
- Namespace
- QueryGuard.Testing
- Assembly
- QueryGuard.Testing.dll
Start(string, QueryGuardPolicy?, IQueryGuardSessionAccessor?, IQueryGuardRedactor?, QueryGuardAnalyzer?, bool)
Opens a scope.
public static QueryGuardScope Start(string name, QueryGuardPolicy? policy = null, IQueryGuardSessionAccessor? accessor = null, IQueryGuardRedactor? redactor = null, QueryGuardAnalyzer? analyzer = null, bool captureOrigin = true)
Parameters
namestringWhat this scope measures: a route pattern, or the name of the behavior under test. It appears in every finding and in the assertion message.
policyQueryGuardPolicyThe policy to evaluate. Defaults to a policy with no budgets.
accessorIQueryGuardSessionAccessorThe accessor the interceptor reads. Defaults to DefaultAccessor; pass the one from your service provider when the interceptor was resolved from it.
redactorIQueryGuardRedactorThe capture settings to honour. Defaults to privacy-first defaults.
analyzerQueryGuardAnalyzerThe analyzer. Defaults to one built from
redactor.captureOriginboolWhether to record where each distinct query was first executed, so a failure can name the call site instead of only the SQL. Defaults to true because a scope is a measurement, not a hot path. Ignored when
redactoris supplied.
Returns
- QueryGuardScope
The open scope.
Exceptions
- ArgumentException
nameis empty or whitespace.