Class ProtoCoverageCollector

Namespace
ProtoTest.Core
Assembly
ProtoTest.Core.dll

Thread-safe base for collectors that aggregate observations as coverage items.

public abstract class ProtoCoverageCollector : IProtoCollector, IProtoReportSource
Inheritance
ProtoCoverageCollector
Implements
Derived
Inherited Members
Extension Methods

Constructors

ProtoCoverageCollector(string)

Thread-safe base for collectors that aggregate observations as coverage items.

protected ProtoCoverageCollector(string targetName)

Parameters

targetName string

Fields

_items

protected readonly Dictionary<string, ProtoReportItem> _items

Field Value

Dictionary<string, ProtoReportItem>

_lock

protected readonly object _lock

Field Value

object

Properties

Category

public abstract string Category { get; }

Property Value

string

TargetName

public string TargetName { get; }

Property Value

string

Methods

CanCollect(ProtoObservation)

Determines whether this collector accepts an observation.

public virtual bool CanCollect(ProtoObservation observation)

Parameters

observation ProtoObservation

Returns

bool

Collect(ProtoObservation)

Records an incoming observation. Implementations should support concurrent calls when tests or requests execute in parallel.

public virtual void Collect(ProtoObservation observation)

Parameters

observation ProtoObservation

GetReportItems()

public virtual IEnumerable<ProtoReportItem> GetReportItems()

Returns

IEnumerable<ProtoReportItem>

MergeMetadata(IReadOnlyDictionary<string, object>?, IReadOnlyDictionary<string, object>?)

protected static IReadOnlyDictionary<string, object>? MergeMetadata(IReadOnlyDictionary<string, object>? existing, IReadOnlyDictionary<string, object>? incoming)

Parameters

existing IReadOnlyDictionary<string, object>
incoming IReadOnlyDictionary<string, object>

Returns

IReadOnlyDictionary<string, object>