Class ProtoTestPreparation

Namespace
ProtoTest.Core
Assembly
ProtoTest.Core.dll

A test method resolved once for execution: the attributes the host orders hooks from, the name the trace records, and the reason the test must skip, if any of the run's skip conditions apply.

public sealed record ProtoTestPreparation : IEquatable<ProtoTestPreparation>
Inheritance
ProtoTestPreparation
Implements
Inherited Members
Extension Methods

Constructors

ProtoTestPreparation(MethodInfo, string, IReadOnlyList<ProtoAttribute>, string?)

A test method resolved once for execution: the attributes the host orders hooks from, the name the trace records, and the reason the test must skip, if any of the run's skip conditions apply.

public ProtoTestPreparation(MethodInfo Method, string TestName, IReadOnlyList<ProtoAttribute> Attributes, string? SkipReason)

Parameters

Method MethodInfo
TestName string
Attributes IReadOnlyList<ProtoAttribute>
SkipReason string

Properties

Attributes

public IReadOnlyList<ProtoAttribute> Attributes { get; init; }

Property Value

IReadOnlyList<ProtoAttribute>

CanRun

Whether the test can run; when false, SkipReason explains why.

public bool CanRun { get; }

Property Value

bool

Method

public MethodInfo Method { get; init; }

Property Value

MethodInfo

SkipReason

public string? SkipReason { get; init; }

Property Value

string

TestName

public string TestName { get; init; }

Property Value

string

Methods

StartAsync(ProtoHost, IProtoTestAttachmentPublisher?)

Starts the test lifecycle. Adapters raise their framework's own skip; this is everything else.

public Task<ProtoExecutionContext> StartAsync(ProtoHost host, IProtoTestAttachmentPublisher? attachmentPublisher = null)

Parameters

host ProtoHost
attachmentPublisher IProtoTestAttachmentPublisher

Returns

Task<ProtoExecutionContext>

StartAsync(ProtoHost, IProtoTestAttachmentPublisher?, CancellationToken)

Starts the test lifecycle with the runner's cancellation token, so setup I/O that can observe cancellation does; a runner whose extension point exposes no token passes None.

public Task<ProtoExecutionContext> StartAsync(ProtoHost host, IProtoTestAttachmentPublisher? attachmentPublisher, CancellationToken cancellationToken)

Parameters

host ProtoHost
attachmentPublisher IProtoTestAttachmentPublisher
cancellationToken CancellationToken

Returns

Task<ProtoExecutionContext>