Class TestBase
abstract class for implementing a test-class, which is a collection of integration tests that may be related to each other.
test methods can be run in a given order by decorating the methods with PriorityAttribute
Implements
IAsyncLifetime
Assembly: FastEndpoints.Testing.dll
Syntax
[TestCaseOrderer(typeof(TestCaseOrderer))]
public abstract class TestBase : IAsyncLifetime, IAsyncDisposable, IFaker
Properties
Cancellation
Declaration
public CancellationToken Cancellation { get; }
Property Value
Context
Declaration
public ITestContext Context { get; }
Property Value
Type |
Description |
ITestContext |
|
Fake
Declaration
public Faker Fake { get; }
Property Value
Output
Declaration
public ITestOutputHelper Output { get; }
Property Value
Type |
Description |
ITestOutputHelper |
|
Methods
SetupAsync()
override this method if you'd like to do some setup before each test-case gets executed.
it is run per test and is analogous to an async constructor for the test-class.
TIP: xunit creates a fresh instance of the test-class per test.
Declaration
protected virtual ValueTask SetupAsync()
Returns
TearDownAsync()
override this method if you'd like to do some teardown/cleanup after each test-case has completed.
it is run per test and is analogous to an async destructor for the test-class.
TIP: xunit creates a fresh instance of the test-class per test.
Declaration
protected virtual ValueTask TearDownAsync()
Returns
Implements
Xunit.IAsyncLifetime