Table of Contents

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

name string

What this scope measures: a route pattern, or the name of the behavior under test. It appears in every finding and in the assertion message.

policy QueryGuardPolicy

The policy to evaluate. Defaults to a policy with no budgets.

accessor IQueryGuardSessionAccessor

The accessor the interceptor reads. Defaults to DefaultAccessor; pass the one from your service provider when the interceptor was resolved from it.

redactor IQueryGuardRedactor

The capture settings to honour. Defaults to privacy-first defaults.

analyzer QueryGuardAnalyzer

The analyzer. Defaults to one built from redactor.

captureOrigin bool

Whether 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 redactor is supplied.

Returns

QueryGuardScope

The open scope.

Exceptions

ArgumentException

name is empty or whitespace.