ITestFilter.Filter(TestFilterContext) Method

Definition

Decides whether the test described by context should run.

public Microsoft.VisualStudio.TestTools.UnitTesting.TestFilterResult Filter(Microsoft.VisualStudio.TestTools.UnitTesting.TestFilterContext context);
abstract member Filter : Microsoft.VisualStudio.TestTools.UnitTesting.TestFilterContext -> Microsoft.VisualStudio.TestTools.UnitTesting.TestFilterResult
Public Function Filter (context As TestFilterContext) As TestFilterResult

Parameters

context
TestFilterContext

Metadata describing the test under consideration.

Returns

Run to let the test execute normally, Drop to silently drop the test (no result emitted), or Skip(String) to report the test as Skipped with a reason.

Remarks

If this method throws, the test is reported as Error with diagnostic UTA078; the exception is never silently swallowed. Implementations that want to opt the test in to running on failure should catch their own exceptions and return Run.

Applies to