.NET API
AgentSourceContract
Namespace Tracon.Testing.Contracts.AgentSources · Assembly
Tracon.Testing.Contracts.Xunit.dllBehavior tests for an IAgentSource implementation.
public abstract class AgentSourceContract : IAsyncLifetime, IAsyncDisposable- Inheritance
- object ← AgentSourceContract
- Derived
- TenantAwareAgentSourceContract, VersionedAgentSourceContract
- Implements
- IAsyncLifetime, IAsyncDisposable
- Inherited Members
- object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Constructors
Section titled “Constructors”AgentSourceContract()
Section titled “ AgentSourceContract()”protected AgentSourceContract()Properties
Section titled “Properties”KnownAgentName
Section titled “ KnownAgentName”Gets an agent name the source definitely resolves.
protected abstract string KnownAgentName { get; }Property Value
Section titled “Property Value”Source
Section titled “ Source”Gets the source under test.
protected IAgentSource Source { get; }Property Value
Section titled “Property Value”UnknownAgentName
Section titled “ UnknownAgentName”Gets an agent name the source definitely does not resolve.
protected virtual string UnknownAgentName { get; }Property Value
Section titled “Property Value”Methods
Section titled “Methods”A_pre_cancelled_token_is_honored()
Section titled “ A_pre_cancelled_token_is_honored()”[Fact]public Task A_pre_cancelled_token_is_honored()Returns
Section titled “Returns”CreateSourceAsync()
Section titled “ CreateSourceAsync()”Creates a source ready for use.
protected abstract ValueTask<IAgentSource> CreateSourceAsync()Returns
Section titled “Returns”DisposeAsync()
Section titled “ DisposeAsync()”public ValueTask DisposeAsync()Returns
Section titled “Returns”Every_listed_agent_resolves()
Section titled “ Every_listed_agent_resolves()”Every name IAgentSource.ListAsync reports must resolve.
[Fact]public Task Every_listed_agent_resolves()Returns
Section titled “Returns”InitializeAsync()
Section titled “ InitializeAsync()”Called immediately after the class has been created, before it is used.
public ValueTask InitializeAsync()Returns
Section titled “Returns”Known_agent_resolves()
Section titled “ Known_agent_resolves()”[Fact]public Task Known_agent_resolves()Returns
Section titled “Returns”Listed_descriptors_name_the_source()
Section titled “ Listed_descriptors_name_the_source()”[Fact]public Task Listed_descriptors_name_the_source()Returns
Section titled “Returns”Listed_names_are_unique_and_valid()
Section titled “ Listed_names_are_unique_and_valid()”[Fact]public Task Listed_names_are_unique_and_valid()Returns
Section titled “Returns”Listing_is_repeatable()
Section titled “ Listing_is_repeatable()”[Fact]public Task Listing_is_repeatable()Returns
Section titled “Returns”Listing_is_safe_under_concurrency()
Section titled “ Listing_is_safe_under_concurrency()”[Fact]public Task Listing_is_safe_under_concurrency()Returns
Section titled “Returns”Name_is_not_empty()
Section titled “ Name_is_not_empty()”[Fact]public void Name_is_not_empty()Priority_is_stable_across_calls()
Section titled “ Priority_is_stable_across_calls()”[Fact]public Task Priority_is_stable_across_calls()Returns
Section titled “Returns”Resolution_is_safe_under_concurrency()
Section titled “ Resolution_is_safe_under_concurrency()”[Fact]public Task Resolution_is_safe_under_concurrency()Returns
Section titled “Returns”Resolved_agent_is_listed()
Section titled “ Resolved_agent_is_listed()”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]public Task Resolved_agent_is_listed()Returns
Section titled “Returns”Unknown_agent_returns_null()
Section titled “ Unknown_agent_returns_null()”[Fact]public Task Unknown_agent_returns_null()