Interface IProtoResource

Namespace
ProtoTest.Core
Assembly
ProtoTest.Core.dll

Something the current test owns. Resources are released in reverse registration order during teardown, after test hooks and attributes have run but before the test's clients are disposed.

public interface IProtoResource
Extension Methods

Properties

Description

Gets a single line describing the resource for the trace, report and viewer.

string Description { get; }

Property Value

string

Id

Gets the stable identity of the resource, for example customer:42.

string Id { get; }

Property Value

string

Kind

Gets the resource kind, for example database or entity.

string Kind { get; }

Property Value

string

Scope

Gets how long the resource lives. Defaults to the test that registered it.

ProtoResourceScope Scope { get; }

Property Value

ProtoResourceScope

Methods

ReleaseAsync(ProtoResourceReleaseContext)

Releases the resource. Each resource is released at most once, so implementations do not have to guard against repeated calls, but must tolerate a failed release being reported.

ValueTask ReleaseAsync(ProtoResourceReleaseContext context)

Parameters

context ProtoResourceReleaseContext

Returns

ValueTask