Skip to content
Tracon

AgentSourceContract

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

Behavior tests for an IAgentSource implementation.

public abstract class AgentSourceContract : IAsyncLifetime, IAsyncDisposable

objectAgentSourceContract

TenantAwareAgentSourceContract, VersionedAgentSourceContract

IAsyncLifetime, IAsyncDisposable

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

protected AgentSourceContract()

Gets an agent name the source definitely resolves.

protected abstract string KnownAgentName { get; }

string

Gets the source under test.

protected IAgentSource Source { get; }

IAgentSource

Gets an agent name the source definitely does not resolve.

protected virtual string UnknownAgentName { get; }

string

[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/AgentSources/AgentSourceContract.cs", 122)]
public Task A_pre_cancelled_token_is_honored()

Task

Creates a source ready for use.

protected abstract ValueTask<IAgentSource> CreateSourceAsync()

ValueTask<IAgentSource>

public ValueTask DisposeAsync()

ValueTask

Every name IAgentSource.ListAsync reports must resolve.

[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/AgentSources/AgentSourceContract.cs", 96)]
public Task Every_listed_agent_resolves()

Task

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

public ValueTask InitializeAsync()

ValueTask

[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/AgentSources/AgentSourceContract.cs", 89)]
public Task Known_agent_resolves()

Task

[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/AgentSources/AgentSourceContract.cs", 82)]
public Task Listed_descriptors_name_the_source()

Task

[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/AgentSources/AgentSourceContract.cs", 74)]
public Task Listed_names_are_unique_and_valid()

Task

[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/AgentSources/AgentSourceContract.cs", 41)]
public Task Listing_is_repeatable()

Task

[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/AgentSources/AgentSourceContract.cs", 49)]
public Task Listing_is_safe_under_concurrency()

Task

[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/AgentSources/AgentSourceContract.cs", 30)]
public void Name_is_not_empty()
[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/AgentSources/AgentSourceContract.cs", 33)]
public Task Priority_is_stable_across_calls()

Task

[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/AgentSources/AgentSourceContract.cs", 62)]
public Task Resolution_is_safe_under_concurrency()

Task

The other half of the M7 consistency rule (see IAgentSource): a name IAgentSource.ResolveAsync resolves must also appear in IAgentSource.ListAsync. AgentSourceContract.KnownAgentName is guaranteed resolvable by contract (see AgentSourceContract.Known_agent_resolves), so it doubles as the “resolvable name” this direction needs without a dedicated fixture hook.

[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/AgentSources/AgentSourceContract.cs", 113)]
public Task Resolved_agent_is_listed()

Task

[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/AgentSources/AgentSourceContract.cs", 92)]
public Task Unknown_agent_returns_null()

Task