# EvalStoreContract

> Tracon documentation. Tracon is a .NET package family that adds a control
> plane on Microsoft Agent Framework, published as NuGet packages that run
> inside your own ASP.NET Core application.
>
> Page: https://tracon.dev/api/tracon.testing.contracts.storage.evalstorecontract/
> Summary: EvalStoreContract: Behavior tests for the IEvalStore contract.

<div class="api-provenance">Namespace Tracon.Testing.Contracts.Storage · Assembly <code>Tracon.Testing.Contracts.Xunit.dll</code></div>

Behavior tests for the [IEvalStore](/api/tracon.ievalstore/) contract.

```csharp
public abstract class EvalStoreContract : TenantIsolationContract<IEvalStore>, IAsyncLifetime, IAsyncDisposable
```

<dl class="api-relations"><dt>Inheritance</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object">object</a> ← <a href="/api/tracon.testing.contracts.storage.storecancellationcontract-1/">StoreCancellationContract&lt;IEvalStore&gt;</a> ← <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/">TenantIsolationContract&lt;IEvalStore&gt;</a> ← <a href="/api/tracon.testing.contracts.storage.evalstorecontract/">EvalStoreContract</a></dd><dt>Implements</dt><dd>IAsyncLifetime, <a href="https://learn.microsoft.com/dotnet/api/system.iasyncdisposable">IAsyncDisposable</a></dd><dt>Inherited Members</dt><dd><a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_TenantA">TenantIsolationContract&lt;IEvalStore&gt;.TenantA</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_TenantB">TenantIsolationContract&lt;IEvalStore&gt;.TenantB</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_UseAmbientTenant_Tracon_Testing_Contracts_Storage_MutableTenantContext_">TenantIsolationContract&lt;IEvalStore&gt;.UseAmbientTenant(MutableTenantContext)</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_SeedAsync_System_String_System_String_System_Threading_CancellationToken_">TenantIsolationContract&lt;IEvalStore&gt;.SeedAsync(string, string, CancellationToken)</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_ExistsAsync_System_String_System_Object_">TenantIsolationContract&lt;IEvalStore&gt;.ExistsAsync(string, object)</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_CountAsync_System_String_System_Threading_CancellationToken_">TenantIsolationContract&lt;IEvalStore&gt;.CountAsync(string, CancellationToken)</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_TryDeleteAsync_System_String_System_Object_">TenantIsolationContract&lt;IEvalStore&gt;.TryDeleteAsync(string, object)</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_TryOverwriteAsync_System_String_System_String_">TenantIsolationContract&lt;IEvalStore&gt;.TryOverwriteAsync(string, string)</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_CancellableReadAsync_System_Threading_CancellationToken_">TenantIsolationContract&lt;IEvalStore&gt;.CancellableReadAsync(CancellationToken)</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_CancellableWriteAsync_System_Threading_CancellationToken_">TenantIsolationContract&lt;IEvalStore&gt;.CancellableWriteAsync(CancellationToken)</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_WroteAnythingAsync">TenantIsolationContract&lt;IEvalStore&gt;.WroteAnythingAsync()</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_Tenant_cannot_read_another_tenants_record">TenantIsolationContract&lt;IEvalStore&gt;.Tenant_cannot_read_another_tenants_record()</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_Tenant_reads_its_own_record">TenantIsolationContract&lt;IEvalStore&gt;.Tenant_reads_its_own_record()</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_Tenant_does_not_see_another_tenants_record_in_the_list">TenantIsolationContract&lt;IEvalStore&gt;.Tenant_does_not_see_another_tenants_record_in_the_list()</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_Tenant_cannot_delete_another_tenants_record">TenantIsolationContract&lt;IEvalStore&gt;.Tenant_cannot_delete_another_tenants_record()</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_Same_name_lives_independently_across_two_tenants">TenantIsolationContract&lt;IEvalStore&gt;.Same_name_lives_independently_across_two_tenants()</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_AmbientTenant">TenantIsolationContract&lt;IEvalStore&gt;.AmbientTenant</a>, <a href="/api/tracon.testing.contracts.storage.storecancellationcontract-1/#Tracon_Testing_Contracts_Storage_StoreCancellationContract_1_CreateStoreAsync">StoreCancellationContract&lt;IEvalStore&gt;.CreateStoreAsync()</a>, <a href="/api/tracon.testing.contracts.storage.storecancellationcontract-1/#Tracon_Testing_Contracts_Storage_StoreCancellationContract_1_InitializeAsync">StoreCancellationContract&lt;IEvalStore&gt;.InitializeAsync()</a>, <a href="/api/tracon.testing.contracts.storage.storecancellationcontract-1/#Tracon_Testing_Contracts_Storage_StoreCancellationContract_1_DisposeAsync">StoreCancellationContract&lt;IEvalStore&gt;.DisposeAsync()</a>, <a href="/api/tracon.testing.contracts.storage.storecancellationcontract-1/#Tracon_Testing_Contracts_Storage_StoreCancellationContract_1_OnDisposeAsync">StoreCancellationContract&lt;IEvalStore&gt;.OnDisposeAsync()</a>, <a href="/api/tracon.testing.contracts.storage.storecancellationcontract-1/#Tracon_Testing_Contracts_Storage_StoreCancellationContract_1_CancellableReadAsync_System_Threading_CancellationToken_">StoreCancellationContract&lt;IEvalStore&gt;.CancellableReadAsync(CancellationToken)</a>, <a href="/api/tracon.testing.contracts.storage.storecancellationcontract-1/#Tracon_Testing_Contracts_Storage_StoreCancellationContract_1_CancellableWriteAsync_System_Threading_CancellationToken_">StoreCancellationContract&lt;IEvalStore&gt;.CancellableWriteAsync(CancellationToken)</a>, <a href="/api/tracon.testing.contracts.storage.storecancellationcontract-1/#Tracon_Testing_Contracts_Storage_StoreCancellationContract_1_WroteAnythingAsync">StoreCancellationContract&lt;IEvalStore&gt;.WroteAnythingAsync()</a>, <a href="/api/tracon.testing.contracts.storage.storecancellationcontract-1/#Tracon_Testing_Contracts_Storage_StoreCancellationContract_1_Canceled_token_throws_on_read">StoreCancellationContract&lt;IEvalStore&gt;.Canceled_token_throws_on_read()</a>, <a href="/api/tracon.testing.contracts.storage.storecancellationcontract-1/#Tracon_Testing_Contracts_Storage_StoreCancellationContract_1_The_write_this_contract_checks_can_be_read_back">StoreCancellationContract&lt;IEvalStore&gt;.The_write_this_contract_checks_can_be_read_back()</a>, <a href="/api/tracon.testing.contracts.storage.storecancellationcontract-1/#Tracon_Testing_Contracts_Storage_StoreCancellationContract_1_Canceled_token_throws_on_write_and_leaves_no_trace">StoreCancellationContract&lt;IEvalStore&gt;.Canceled_token_throws_on_write_and_leaves_no_trace()</a>, <a href="/api/tracon.testing.contracts.storage.storecancellationcontract-1/#Tracon_Testing_Contracts_Storage_StoreCancellationContract_1_Store">StoreCancellationContract&lt;IEvalStore&gt;.Store</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone">object.MemberwiseClone()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.tostring">object.ToString()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">object.Equals(object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode">object.GetHashCode()</a></dd></dl>

## Constructors

### <a id="Tracon_Testing_Contracts_Storage_EvalStoreContract__ctor"></a> EvalStoreContract\(\)

```csharp
protected EvalStoreContract()
```

## Properties

### <a id="Tracon_Testing_Contracts_Storage_EvalStoreContract_QualifiedEvalCasesTable"></a> QualifiedEvalCasesTable

The fully qualified `eval_cases` table reference this provider's raw SQL should use.

```csharp
protected virtual string QualifiedEvalCasesTable { get; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)

### <a id="Tracon_Testing_Contracts_Storage_EvalStoreContract_SupportsRawSql"></a> SupportsRawSql

Whether this store's backing state can be written to directly (SQL providers only).

```csharp
protected virtual bool SupportsRawSql { get; }
```

#### Property Value

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

## Methods

### <a id="Tracon_Testing_Contracts_Storage_EvalStoreContract_A_row_written_before_expected_tool_calls_existed_reads_back_its_names"></a> A\_row\_written\_before\_expected\_tool\_calls\_existed\_reads\_back\_its\_names\(\)

A row written before `expected_tool_calls` existed holds only the
comma separated names of `expected_tools`; it reads back as calls
without arguments.

```csharp
[Fact]
public Task A_row_written_before_expected_tool_calls_existed_reads_back_its_names()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

The test task.

### <a id="Tracon_Testing_Contracts_Storage_EvalStoreContract_AddCaseAsync_assigns_seq_atomically"></a> AddCaseAsync\_assigns\_seq\_atomically\(\)

```csharp
[Fact]
public Task AddCaseAsync_assigns_seq_atomically()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_EvalStoreContract_AddCaseAsync_concurrent_promotions_produce_distinct_seq"></a> AddCaseAsync\_concurrent\_promotions\_produce\_distinct\_seq\(\)

```csharp
[Fact]
public Task AddCaseAsync_concurrent_promotions_produce_distinct_seq()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_EvalStoreContract_AddCaseAsync_does_not_separate_sourceless_cases_from_hand_written_ones"></a> AddCaseAsync\_does\_not\_separate\_sourceless\_cases\_from\_hand\_written\_ones\(\)

```csharp
[Fact]
public Task AddCaseAsync_does_not_separate_sourceless_cases_from_hand_written_ones()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_EvalStoreContract_AddCaseAsync_returns_the_existing_case_the_second_time_for_the_same_source_run_id"></a> AddCaseAsync\_returns\_the\_existing\_case\_the\_second\_time\_for\_the\_same\_source\_run\_id\(\)

```csharp
[Fact]
public Task AddCaseAsync_returns_the_existing_case_the_second_time_for_the_same_source_run_id()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_EvalStoreContract_AddCaseAsync_stores_source_fields_and_expected_fields"></a> AddCaseAsync\_stores\_source\_fields\_and\_expected\_fields\(\)

```csharp
[Fact]
public Task AddCaseAsync_stores_source_fields_and_expected_fields()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_EvalStoreContract_AddCaseAsync_stores_the_parameter_values_of_a_promoted_run"></a> AddCaseAsync\_stores\_the\_parameter\_values\_of\_a\_promoted\_run\(\)

A promoted case carries the parameter values its source run recorded, and
they survive the read back.

```csharp
[Fact]
public Task AddCaseAsync_stores_the_parameter_values_of_a_promoted_run()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

The test task.

#### Remarks

Without them a promoted case of a parameterized agent fails on a missing
value, or runs on a default the production run never used.

### <a id="Tracon_Testing_Contracts_Storage_EvalStoreContract_Case_result_is_recorded_and_filtered_by_tenant"></a> Case\_result\_is\_recorded\_and\_filtered\_by\_tenant\(\)

```csharp
[Fact]
public Task Case_result_is_recorded_and_filtered_by_tenant()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_EvalStoreContract_CountAsync_System_String_System_Threading_CancellationToken_"></a> CountAsync\(string, CancellationToken\)

Reports how many records the given tenant sees through the listing endpoint.

```csharp
protected override ValueTask<int> CountAsync(string tenantId, CancellationToken cancellationToken)
```

#### Parameters

`tenantId` [string](https://learn.microsoft.com/dotnet/api/system.string)

The reading tenant.

`cancellationToken` [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken)

The token every store call inside the hook must be handed; see
[TenantIsolationContract.SeedAsync](/api/tracon.testing.contracts.storage/).

#### Returns

 [ValueTask](https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask\-1)<[int](https://learn.microsoft.com/dotnet/api/system.int32)\>

The number of records seen.

### <a id="Tracon_Testing_Contracts_Storage_EvalStoreContract_DeleteSuiteAsync_also_deletes_its_cases_and_runs"></a> DeleteSuiteAsync\_also\_deletes\_its\_cases\_and\_runs\(\)

```csharp
[Fact]
public Task DeleteSuiteAsync_also_deletes_its_cases_and_runs()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_EvalStoreContract_DiffRunsAsync_counts_a_case_recorded_twice_once"></a> DiffRunsAsync\_counts\_a\_case\_recorded\_twice\_once\(\)

```csharp
[Fact]
public Task DiffRunsAsync_counts_a_case_recorded_twice_once()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_EvalStoreContract_DiffRunsAsync_refuses_an_unfinished_run"></a> DiffRunsAsync\_refuses\_an\_unfinished\_run\(\)

```csharp
[Fact]
public Task DiffRunsAsync_refuses_an_unfinished_run()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_EvalStoreContract_DiffRunsAsync_refuses_two_runs_of_different_suites"></a> DiffRunsAsync\_refuses\_two\_runs\_of\_different\_suites\(\)

```csharp
[Fact]
public Task DiffRunsAsync_refuses_two_runs_of_different_suites()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_EvalStoreContract_DiffRunsAsync_returns_null_for_an_unknown_run"></a> DiffRunsAsync\_returns\_null\_for\_an\_unknown\_run\(\)

```csharp
[Fact]
public Task DiffRunsAsync_returns_null_for_an_unknown_run()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_EvalStoreContract_DiffRunsAsync_returns_null_for_another_tenants_run"></a> DiffRunsAsync\_returns\_null\_for\_another\_tenants\_run\(\)

```csharp
[Fact]
public Task DiffRunsAsync_returns_null_for_another_tenants_run()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_EvalStoreContract_DiffRunsAsync_separates_the_six_buckets"></a> DiffRunsAsync\_separates\_the\_six\_buckets\(\)

```csharp
[Fact]
public Task DiffRunsAsync_separates_the_six_buckets()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_EvalStoreContract_DiffRunsAsync_throws_when_retention_removed_only_SOME_of_the_results"></a> DiffRunsAsync\_throws\_when\_retention\_removed\_only\_SOME\_of\_the\_results\(\)

```csharp
[Fact]
public Task DiffRunsAsync_throws_when_retention_removed_only_SOME_of_the_results()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_EvalStoreContract_DiffRunsAsync_throws_when_the_baseline_details_were_removed_by_retention"></a> DiffRunsAsync\_throws\_when\_the\_baseline\_details\_were\_removed\_by\_retention\(\)

```csharp
[Fact]
public Task DiffRunsAsync_throws_when_the_baseline_details_were_removed_by_retention()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_EvalStoreContract_DiffRunsAsync_throws_when_the_candidate_details_were_removed_by_retention"></a> DiffRunsAsync\_throws\_when\_the\_candidate\_details\_were\_removed\_by\_retention\(\)

```csharp
[Fact]
public Task DiffRunsAsync_throws_when_the_candidate_details_were_removed_by_retention()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_EvalStoreContract_ExecuteRawAsync_System_String_"></a> ExecuteRawAsync\(string\)

Runs raw SQL against the backing store. Only called when [EvalStoreContract.SupportsRawSql](/api/tracon.testing.contracts.storage.evalstorecontract/#Tracon_Testing_Contracts_Storage_EvalStoreContract_SupportsRawSql) is [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool).

```csharp
protected virtual ValueTask ExecuteRawAsync(string sql)
```

#### Parameters

`sql` [string](https://learn.microsoft.com/dotnet/api/system.string)

The statement.

#### Returns

 [ValueTask](https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask)

A task that completes when the statement has run.

### <a id="Tracon_Testing_Contracts_Storage_EvalStoreContract_ExistsAsync_System_String_System_Object_"></a> ExistsAsync\(string, object\)

Reports whether the record is visible from the given tenant's viewpoint.

```csharp
protected override ValueTask<bool> ExistsAsync(string tenantId, object key)
```

#### Parameters

`tenantId` [string](https://learn.microsoft.com/dotnet/api/system.string)

The reading tenant.

`key` [object](https://learn.microsoft.com/dotnet/api/system.object)

The key returned by [TenantIsolationContract.SeedAsync](/api/tracon.testing.contracts.storage/).

#### Returns

 [ValueTask](https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask\-1)<[bool](https://learn.microsoft.com/dotnet/api/system.boolean)\>

[true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool) if the record is visible.

### <a id="Tracon_Testing_Contracts_Storage_EvalStoreContract_FormatIdForRawSql_System_Guid_"></a> FormatIdForRawSql\(Guid\)

Formats an id for embedding in raw SQL. A provider that stores a
[Guid](https://learn.microsoft.com/dotnet/api/system.guid) as text and compares case-sensitively (SQLite, in
uppercase) must override the default (lowercase
[Guid.ToString](https://learn.microsoft.com/dotnet/api/system.guid)).

```csharp
protected virtual string FormatIdForRawSql(Guid id)
```

#### Parameters

`id` [Guid](https://learn.microsoft.com/dotnet/api/system.guid)

The id.

#### Returns

 [string](https://learn.microsoft.com/dotnet/api/system.string)

The id as the provider spells it.

### <a id="Tracon_Testing_Contracts_Storage_EvalStoreContract_GetSuiteAsync_returns_null_for_another_tenant"></a> GetSuiteAsync\_returns\_null\_for\_another\_tenant\(\)

```csharp
[Fact]
public Task GetSuiteAsync_returns_null_for_another_tenant()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_EvalStoreContract_ListSuitesAsync_returns_only_that_tenant"></a> ListSuitesAsync\_returns\_only\_that\_tenant\(\)

```csharp
[Fact]
public Task ListSuitesAsync_returns_only_that_tenant()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_EvalStoreContract_QueryRunsAsync_filters_by_suite_and_puts_the_newest_first"></a> QueryRunsAsync\_filters\_by\_suite\_and\_puts\_the\_newest\_first\(\)

```csharp
[Fact]
public Task QueryRunsAsync_filters_by_suite_and_puts_the_newest_first()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_EvalStoreContract_ReplaceCasesAsync_assigns_sequence_numbers_and_replaces_previous_cases"></a> ReplaceCasesAsync\_assigns\_sequence\_numbers\_and\_replaces\_previous\_cases\(\)

```csharp
[Fact]
public Task ReplaceCasesAsync_assigns_sequence_numbers_and_replaces_previous_cases()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_EvalStoreContract_ReplaceCasesAsync_keeps_an_identifier_it_was_given"></a> ReplaceCasesAsync\_keeps\_an\_identifier\_it\_was\_given\(\)

```csharp
[Fact]
public Task ReplaceCasesAsync_keeps_an_identifier_it_was_given()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_EvalStoreContract_ReplaceCasesAsync_keeps_the_promotion_fields_it_was_given"></a> ReplaceCasesAsync\_keeps\_the\_promotion\_fields\_it\_was\_given\(\)

```csharp
[Fact]
public Task ReplaceCasesAsync_keeps_the_promotion_fields_it_was_given()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_EvalStoreContract_ReplaceCasesAsync_leaves_parameters_null_for_a_case_that_declares_none"></a> ReplaceCasesAsync\_leaves\_parameters\_null\_for\_a\_case\_that\_declares\_none\(\)

```csharp
[Fact]
public Task ReplaceCasesAsync_leaves_parameters_null_for_a_case_that_declares_none()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_EvalStoreContract_ReplaceCasesAsync_reads_back_an_empty_list_for_a_case_that_expects_no_tool_call"></a> ReplaceCasesAsync\_reads\_back\_an\_empty\_list\_for\_a\_case\_that\_expects\_no\_tool\_call\(\)

A case that expects no tool call reads back an empty list, never [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null).

```csharp
[Fact]
public Task ReplaceCasesAsync_reads_back_an_empty_list_for_a_case_that_expects_no_tool_call()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

The test task.

### <a id="Tracon_Testing_Contracts_Storage_EvalStoreContract_ReplaceCasesAsync_round_trips_an_expected_argument_of_every_json_kind"></a> ReplaceCasesAsync\_round\_trips\_an\_expected\_argument\_of\_every\_json\_kind\(\)

An argument of every JSON kind survives the round trip, and a call
without arguments stays distinct from one with an empty set.

```csharp
[Fact]
public Task ReplaceCasesAsync_round_trips_an_expected_argument_of_every_json_kind()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

The test task.

#### Remarks

The column is `jsonb` in PostgreSQL and text elsewhere. `jsonb`
normalizes number spelling and object member order, so the comparison is
by JSON meaning; an argument that comes back as a different KIND (a
number as a string, a nested object as text) is the failure this guards.

### <a id="Tracon_Testing_Contracts_Storage_EvalStoreContract_ReplaceCasesAsync_stores_expected_tool_calls_and_context"></a> ReplaceCasesAsync\_stores\_expected\_tool\_calls\_and\_context\(\)

```csharp
[Fact]
public Task ReplaceCasesAsync_stores_expected_tool_calls_and_context()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_EvalStoreContract_ReplaceCasesAsync_stores_parameter_values_for_a_parameterized_agent"></a> ReplaceCasesAsync\_stores\_parameter\_values\_for\_a\_parameterized\_agent\(\)

```csharp
[Fact]
public Task ReplaceCasesAsync_stores_parameter_values_for_a_parameterized_agent()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_EvalStoreContract_Run_lifecycle_transitions_from_running_to_completed"></a> Run\_lifecycle\_transitions\_from\_running\_to\_completed\(\)

```csharp
[Fact]
public Task Run_lifecycle_transitions_from_running_to_completed()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_EvalStoreContract_Run_reads_do_not_leak_across_tenants"></a> Run\_reads\_do\_not\_leak\_across\_tenants\(\)

```csharp
[Fact]
public Task Run_reads_do_not_leak_across_tenants()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_EvalStoreContract_SaveSuiteAsync_assigns_an_id_to_a_new_suite"></a> SaveSuiteAsync\_assigns\_an\_id\_to\_a\_new\_suite\(\)

```csharp
[Fact]
public Task SaveSuiteAsync_assigns_an_id_to_a_new_suite()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_EvalStoreContract_SaveSuiteAsync_keeps_the_id_for_the_same_name_and_updates"></a> SaveSuiteAsync\_keeps\_the\_id\_for\_the\_same\_name\_and\_updates\(\)

```csharp
[Fact]
public Task SaveSuiteAsync_keeps_the_id_for_the_same_name_and_updates()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_EvalStoreContract_SaveSuiteAsync_round_trips_a_suite_that_carries_no_checks"></a> SaveSuiteAsync\_round\_trips\_a\_suite\_that\_carries\_no\_checks\(\)

A suite saved with no checks round-trips through every provider.

```csharp
[Fact]
public Task SaveSuiteAsync_round_trips_a_suite_that_carries_no_checks()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

#### Remarks

The eval side of the same class as the schedule payload: the unset
value used to reach the column as the literal `null`, which SQL
Server's `CHECK (ISJSON(checks) = 1)` rejects.

### <a id="Tracon_Testing_Contracts_Storage_EvalStoreContract_SeedAsync_System_String_System_String_System_Threading_CancellationToken_"></a> SeedAsync\(string, string, CancellationToken\)

Writes a sample record for the given tenant.

```csharp
protected override ValueTask<object> SeedAsync(string tenantId, string name, CancellationToken cancellationToken)
```

#### Parameters

`tenantId` [string](https://learn.microsoft.com/dotnet/api/system.string)

The tenant that owns the record.

`name` [string](https://learn.microsoft.com/dotnet/api/system.string)

The name distinguishing the record. The same name may be used by two tenants.

`cancellationToken` [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken)

The token every store call inside the hook must be handed. The
cancellation contract calls this hook with a token that is already
cancelled, so a hook that drops the token reports a store as sound
when it is not.

#### Returns

 [ValueTask](https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask\-1)<[object](https://learn.microsoft.com/dotnet/api/system.object)\>

The key to use for reading the record back.

### <a id="Tracon_Testing_Contracts_Storage_EvalStoreContract_TryDeleteAsync_System_String_System_Object_"></a> TryDeleteAsync\(string, object\)

Attempts to delete the record on behalf of the given tenant.

```csharp
protected override ValueTask<bool?> TryDeleteAsync(string tenantId, object key)
```

#### Parameters

`tenantId` [string](https://learn.microsoft.com/dotnet/api/system.string)

The tenant attempting the delete.

`key` [object](https://learn.microsoft.com/dotnet/api/system.object)

The key returned by [TenantIsolationContract.SeedAsync](/api/tracon.testing.contracts.storage/).

#### Returns

 [ValueTask](https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask\-1)<[bool](https://learn.microsoft.com/dotnet/api/system.boolean)?\>

[true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool) if the delete succeeded, [false](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool)
if the record was not found; [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) if the store does
not offer deletion.
