Skip to content
Tracon

RunJudgeContract

Namespace Tracon.Testing.Contracts.Judges · Assembly Tracon.Testing.Contracts.Xunit.dll

Behavior tests for an IRunJudge implementation.

public abstract class RunJudgeContract : IAsyncLifetime, IAsyncDisposable
Inheritance
object ← RunJudgeContract
Implements
IAsyncLifetime, IAsyncDisposable
Inherited Members
object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
protected RunJudgeContract()

Gets the number of calls used by the deterministic concurrency probe.

protected virtual int ConcurrentCallCount { get; }

int

The judge under test.

protected IRunJudge Judge { get; }

IRunJudge

[Fact]
public Task A_pre_cancelled_token_is_honored()

Task

Concurrent_calls_start_together_and_complete()

Section titled “ Concurrent_calls_start_together_and_complete()”
[Fact]
public Task Concurrent_calls_start_together_and_complete()

Task

Creates a normal completed-run context.

protected virtual RunJudgeContext CreateContext()

RunJudgeContext

Creates the judge under test.

protected abstract ValueTask<IRunJudge> CreateJudgeAsync()

ValueTask<IRunJudge>

public ValueTask DisposeAsync()

ValueTask

Every_score_in_a_judgment_can_be_stored()

Section titled “ Every_score_in_a_judgment_can_be_stored()”
[Fact]
public Task Every_score_in_a_judgment_can_be_stored()

Task

Called immediately after the class has been created, before it is used.

public ValueTask InitializeAsync()

ValueTask

Name_is_a_stable_valid_identifier_across_calls()

Section titled “ Name_is_a_stable_valid_identifier_across_calls()”
[Fact]
public Task Name_is_a_stable_valid_identifier_across_calls()

Task

Repeated_calls_with_the_same_context_complete()

Section titled “ Repeated_calls_with_the_same_context_complete()”
[Fact]
public Task Repeated_calls_with_the_same_context_complete()

Task

Asserts that every score in a judgment satisfies the stored invariants.

protected static void ShouldBeStorable(RunJudgment judgment)

judgment RunJudgment

The judgment under test.

An empty judgment passes: it says the judge reached no decision, and nothing is written. What must never happen is a judgment that Tracon then refuses to store — a repeated name, an out-of-range value, a value shape that does not match its kind, or an over-long version.

Whitespace_output_and_empty_tools_do_not_throw()

Section titled “ Whitespace_output_and_empty_tools_do_not_throw()”
[Fact]
public Task Whitespace_output_and_empty_tools_do_not_throw()

Task