Skip to content

Instantly share code, notes, and snippets.

@wullemsb
Created September 10, 2019 06:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wullemsb/78105ea98dd5854d32fa03616b214ea3 to your computer and use it in GitHub Desktop.
Save wullemsb/78105ea98dd5854d32fa03616b214ea3 to your computer and use it in GitHub Desktop.
namespace Xunit
{
/// <summary>
/// Used to provide asynchronous lifetime functionality. Currently supported:
/// - Test classes
/// - Classes used in <see cref="IClassFixture{TFixture}"/>
/// - Classes used in <see cref="ICollectionFixture{TFixture}"/>.
/// </summary>
public interface IAsyncLifetime
{
/// <summary>
/// Called immediately after the class has been created, before it is used.
/// </summary>
Task InitializeAsync();
/// <summary>
/// Called when an object is no longer needed. Called just before <see cref="IDisposable.Dispose"/>
/// if the class also implements that.
/// </summary>
Task DisposeAsync();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment