# RunScoreStoreContract

> 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.runscorestorecontract/
> Summary: RunScoreStoreContract: Behavior tests for the IRunScoreStore contract.

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

Behavior tests for the [IRunScoreStore](/api/tracon.irunscorestore/) contract.

```csharp
public abstract class RunScoreStoreContract : TenantIsolationContract<IRunScoreStore>, 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;IRunScoreStore&gt;</a> ← <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/">TenantIsolationContract&lt;IRunScoreStore&gt;</a> ← <a href="/api/tracon.testing.contracts.storage.runscorestorecontract/">RunScoreStoreContract</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;IRunScoreStore&gt;.TenantA</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_TenantB">TenantIsolationContract&lt;IRunScoreStore&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;IRunScoreStore&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;IRunScoreStore&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;IRunScoreStore&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;IRunScoreStore&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;IRunScoreStore&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;IRunScoreStore&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;IRunScoreStore&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;IRunScoreStore&gt;.CancellableWriteAsync(CancellationToken)</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_WroteAnythingAsync">TenantIsolationContract&lt;IRunScoreStore&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;IRunScoreStore&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;IRunScoreStore&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;IRunScoreStore&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;IRunScoreStore&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;IRunScoreStore&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;IRunScoreStore&gt;.AmbientTenant</a>, <a href="/api/tracon.testing.contracts.storage.storecancellationcontract-1/#Tracon_Testing_Contracts_Storage_StoreCancellationContract_1_CreateStoreAsync">StoreCancellationContract&lt;IRunScoreStore&gt;.CreateStoreAsync()</a>, <a href="/api/tracon.testing.contracts.storage.storecancellationcontract-1/#Tracon_Testing_Contracts_Storage_StoreCancellationContract_1_InitializeAsync">StoreCancellationContract&lt;IRunScoreStore&gt;.InitializeAsync()</a>, <a href="/api/tracon.testing.contracts.storage.storecancellationcontract-1/#Tracon_Testing_Contracts_Storage_StoreCancellationContract_1_DisposeAsync">StoreCancellationContract&lt;IRunScoreStore&gt;.DisposeAsync()</a>, <a href="/api/tracon.testing.contracts.storage.storecancellationcontract-1/#Tracon_Testing_Contracts_Storage_StoreCancellationContract_1_OnDisposeAsync">StoreCancellationContract&lt;IRunScoreStore&gt;.OnDisposeAsync()</a>, <a href="/api/tracon.testing.contracts.storage.storecancellationcontract-1/#Tracon_Testing_Contracts_Storage_StoreCancellationContract_1_CancellableReadAsync_System_Threading_CancellationToken_">StoreCancellationContract&lt;IRunScoreStore&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;IRunScoreStore&gt;.CancellableWriteAsync(CancellationToken)</a>, <a href="/api/tracon.testing.contracts.storage.storecancellationcontract-1/#Tracon_Testing_Contracts_Storage_StoreCancellationContract_1_WroteAnythingAsync">StoreCancellationContract&lt;IRunScoreStore&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;IRunScoreStore&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;IRunScoreStore&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;IRunScoreStore&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;IRunScoreStore&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>

## Remarks

The in-memory store and the three SQL providers must pass the same
scenarios. Critical rule: when the same author writes the same
[RunScore.Name](/api/tracon.runscore/#Tracon_RunScore_Name) onto the same target (a run or a message) a
second time, the row is **updated**, not duplicated -- a
different name opens a new row, and neither rule applies when the author is
empty (an anonymous setup).

## Constructors

### <a id="Tracon_Testing_Contracts_Storage_RunScoreStoreContract__ctor"></a> RunScoreStoreContract\(\)

```csharp
protected RunScoreStoreContract()
```

## Methods

### <a id="Tracon_Testing_Contracts_Storage_RunScoreStoreContract_A_categorical_score_carrying_a_numeric_value_is_REJECTED"></a> A\_categorical\_score\_carrying\_a\_numeric\_value\_is\_REJECTED\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunScoreStoreContract_A_categorical_score_is_stored_as_text"></a> A\_categorical\_score\_is\_stored\_as\_text\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunScoreStoreContract_A_decimal_value_is_NOT_rounded"></a> A\_decimal\_value\_is\_NOT\_rounded\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunScoreStoreContract_A_null_value_is_counted_but_does_not_enter_the_average"></a> A\_null\_value\_is\_counted\_but\_does\_not\_enter\_the\_average\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunScoreStoreContract_A_null_value_means_NO_MEASUREMENT_not_zero"></a> A\_null\_value\_means\_NO\_MEASUREMENT\_not\_zero\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunScoreStoreContract_A_numeric_score_carrying_a_text_value_is_REJECTED"></a> A\_numeric\_score\_carrying\_a\_text\_value\_is\_REJECTED\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunScoreStoreContract_A_score_with_no_evaluator_version_reads_back_as_null"></a> A\_score\_with\_no\_evaluator\_version\_reads\_back\_as\_null\(\)

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

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

The shape every row written before the version column existed has, and
the shape every human and API score keeps. NULL means no VERSION WAS
RESOLVED — it is not "version zero" and it must not make the read throw.

### <a id="Tracon_Testing_Contracts_Storage_RunScoreStoreContract_A_whole_number_value_is_read_back_as_a_number_not_an_integer"></a> A\_whole\_number\_value\_is\_read\_back\_as\_a\_number\_not\_an\_integer\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunScoreStoreContract_An_empty_match_returns_empty_lists_not_null"></a> An\_empty\_match\_returns\_empty\_lists\_not\_null\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunScoreStoreContract_An_empty_string_Author_is_excluded_from_the_author_breakdown_like_no_author"></a> An\_empty\_string\_Author\_is\_excluded\_from\_the\_author\_breakdown\_like\_no\_author\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunScoreStoreContract_An_empty_string_MessageId_is_treated_the_same_as_no_message"></a> An\_empty\_string\_MessageId\_is\_treated\_the\_same\_as\_no\_message\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunScoreStoreContract_An_evaluator_version_AT_the_bound_is_accepted"></a> An\_evaluator\_version\_AT\_the\_bound\_is\_accepted\(\)

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

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

The bound itself stays writable — an off-by-one here would reject legal versions.

### <a id="Tracon_Testing_Contracts_Storage_RunScoreStoreContract_An_evaluator_version_round_trips"></a> An\_evaluator\_version\_round\_trips\(\)

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

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

The real risk this case guards is an ordinal shift. A SQL store reads the
row by bare ordinal, so a column slotted into the middle of the select
list instead of appended to it moves every field after it. The shift is
silent wherever the neighbouring types agree, which is why this asserts
the other fields as well and not just the version.

### <a id="Tracon_Testing_Contracts_Storage_RunScoreStoreContract_An_illegal_name_is_REJECTED_System_String_"></a> An\_illegal\_name\_is\_REJECTED\(string\)

```csharp
[Theory]
[InlineData(new object?[] { "has space" })]
[InlineData(new object?[] { "" })]
[InlineData(new object?[] { "naïve" })]
[InlineData(new object?[] { "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" })]
public Task An_illegal_name_is_REJECTED(string name)
```

#### Parameters

`name` [string](https://learn.microsoft.com/dotnet/api/system.string)

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunScoreStoreContract_An_over_long_evaluator_version_is_REJECTED"></a> An\_over\_long\_evaluator\_version\_is\_REJECTED\(\)

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

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

The bound is a stored-column bound, so every store enforces it, not just
the SQL ones. A judge supplies this value; without the bound a
third-party judge would decide how much of a customer's table one score
row occupies.

### <a id="Tracon_Testing_Contracts_Storage_RunScoreStoreContract_Another_tenants_score_cannot_be_deleted"></a> Another\_tenants\_score\_cannot\_be\_deleted\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunScoreStoreContract_Another_tenants_score_is_not_visible"></a> Another\_tenants\_score\_is\_not\_visible\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunScoreStoreContract_Another_tenants_score_never_enters_the_summary"></a> Another\_tenants\_score\_never\_enters\_the\_summary\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunScoreStoreContract_Author_breakdown_excludes_scores_with_no_author"></a> Author\_breakdown\_excludes\_scores\_with\_no\_author\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunScoreStoreContract_Categorical_scores_report_category_counts_not_an_average"></a> Categorical\_scores\_report\_category\_counts\_not\_an\_average\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunScoreStoreContract_Category_cardinality_beyond_MaxRows_is_truncated_and_reported"></a> Category\_cardinality\_beyond\_MaxRows\_is\_truncated\_and\_reported\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunScoreStoreContract_Concurrent_writes_of_the_SAME_name_leave_exactly_one_row"></a> Concurrent\_writes\_of\_the\_SAME\_name\_leave\_exactly\_one\_row\(\)

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

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

A uniqueness key that does not match shows up first as a race: two
writers each miss the other's row and both insert.

### <a id="Tracon_Testing_Contracts_Storage_RunScoreStoreContract_Concurrent_writes_with_null_and_empty_MessageId_leave_exactly_one_row"></a> Concurrent\_writes\_with\_null\_and\_empty\_MessageId\_leave\_exactly\_one\_row\(\)

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

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

A NULL [RunScore.MessageId](/api/tracon.runscore/#Tracon_RunScore_MessageId) and an empty ONE both mean "the
whole run" ([RunScoreStoreContract.Score_with_no_message_id_belongs_to_the_whole_run](/api/tracon.testing.contracts.storage.runscorestorecontract/#Tracon_Testing_Contracts_Storage_RunScoreStoreContract_Score_with_no_message_id_belongs_to_the_whole_run)),
so a concurrent write of one shape racing a write of the OTHER shape must
still collapse to a single row -- not two, one per shape.

### <a id="Tracon_Testing_Contracts_Storage_RunScoreStoreContract_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_RunScoreStoreContract_Deleting_a_nonexistent_score_returns_false"></a> Deleting\_a\_nonexistent\_score\_returns\_false\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunScoreStoreContract_Different_authors_score_the_same_target_independently"></a> Different\_authors\_score\_the\_same\_target\_independently\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunScoreStoreContract_Different_kinds_of_the_same_name_are_not_averaged_together"></a> Different\_kinds\_of\_the\_same\_name\_are\_not\_averaged\_together\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunScoreStoreContract_Different_messages_are_scored_independently"></a> Different\_messages\_are\_scored\_independently\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunScoreStoreContract_Empty_author_makes_EVERY_call_open_a_new_row"></a> Empty\_author\_makes\_EVERY\_call\_open\_a\_new\_row\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunScoreStoreContract_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_RunScoreStoreContract_Hour_buckets_group_scores_within_the_same_hour"></a> Hour\_buckets\_group\_scores\_within\_the\_same\_hour\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunScoreStoreContract_MessageId_is_never_a_breakdown_dimension"></a> MessageId\_is\_never\_a\_breakdown\_dimension\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunScoreStoreContract_Repeated_writes_of_the_SAME_name_leave_exactly_one_row"></a> Repeated\_writes\_of\_the\_SAME\_name\_leave\_exactly\_one\_row\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunScoreStoreContract_Rescoring_with_a_NEWER_evaluator_replaces_the_stored_version"></a> Rescoring\_with\_a\_NEWER\_evaluator\_replaces\_the\_stored\_version\(\)

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

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

An upgraded evaluator writes the same (author, name) pair again. The row
is updated, and the version has to move with it — a stale version on an
updated score is exactly the confusion the column exists to remove.

### <a id="Tracon_Testing_Contracts_Storage_RunScoreStoreContract_Same_author_scoring_the_same_target_twice_UPDATES_the_row"></a> Same\_author\_scoring\_the\_same\_target\_twice\_UPDATES\_the\_row\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunScoreStoreContract_Same_author_scoring_the_same_target_under_a_DIFFERENT_name_opens_a_new_row"></a> Same\_author\_scoring\_the\_same\_target\_under\_a\_DIFFERENT\_name\_opens\_a\_new\_row\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunScoreStoreContract_Score_is_deleted"></a> Score\_is\_deleted\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunScoreStoreContract_Score_with_no_message_id_belongs_to_the_whole_run"></a> Score\_with\_no\_message\_id\_belongs\_to\_the\_whole\_run\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunScoreStoreContract_Scores_are_grouped_into_time_buckets_and_empty_buckets_are_omitted"></a> Scores\_are\_grouped\_into\_time\_buckets\_and\_empty\_buckets\_are\_omitted\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunScoreStoreContract_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.

#### Remarks

A score is attached to a run; the distinguishing key is the run id.
Two tenants use the same run id: if isolation leaked, tenant B would
see tenant A's score.

### <a id="Tracon_Testing_Contracts_Storage_RunScoreStoreContract_Summary_can_be_read_while_a_score_is_being_written"></a> Summary\_can\_be\_read\_while\_a\_score\_is\_being\_written\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunScoreStoreContract_Target_Message_excludes_run_level_scores"></a> Target\_Message\_excludes\_run\_level\_scores\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunScoreStoreContract_Target_Run_excludes_message_level_scores"></a> Target\_Run\_excludes\_message\_level\_scores\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunScoreStoreContract_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.

### <a id="Tracon_Testing_Contracts_Storage_RunScoreStoreContract_Updating_ONE_name_leaves_the_authors_other_names_untouched"></a> Updating\_ONE\_name\_leaves\_the\_authors\_other\_names\_untouched\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunScoreStoreContract_Week_buckets_start_on_Monday_and_group_the_whole_week"></a> Week\_buckets\_start\_on\_Monday\_and\_group\_the\_whole\_week\(\)

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

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

The week bucket is the riskiest of the three: each of the four
implementations (three SQL dialects plus the in-memory store) computes
"the preceding Monday" with a DIFFERENT formula (see
`RunScoreBucketing.Truncate`'s remarks and each provider's
`SelectRunScoreSeries` query). This test is what proves they agree.

### <a id="Tracon_Testing_Contracts_Storage_RunScoreStoreContract_Written_score_is_read_back"></a> Written\_score\_is\_read\_back\(\)

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

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