ITestFilter.Filter(TestFilterContext) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.