Show / Hide Table of Contents

Class BeforeAfterTestAttribute

Base attribute which indicates a test method interception (allows code to be run before and after the test is run).

Inheritance
Object
BeforeAfterTestAttribute
Namespace: Xunit.Sdk
Assembly: xunit.core.dll
Syntax
public abstract class BeforeAfterTestAttribute : Attribute

Methods

| Improve this Doc View Source

After(MethodInfo)

This method is called after the test method is executed.

Declaration
public virtual void After(MethodInfo methodUnderTest)
Parameters
Type Name Description
MethodInfo methodUnderTest

The method under test

| Improve this Doc View Source

Before(MethodInfo)

This method is called before the test method is executed.

Declaration
public virtual void Before(MethodInfo methodUnderTest)
Parameters
Type Name Description
MethodInfo methodUnderTest

The method under test

  • Improve this Doc
  • View Source
Back to top Generated by DocFX