# WorkflowRequestStoreContract

> 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.workflowrequeststorecontract/
> Summary: WorkflowRequestStoreContract: Behavior tests for the IWorkflowRequestStore contract.

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

Behavior tests for the [IWorkflowRequestStore](/api/tracon.iworkflowrequeststore/) contract.

```csharp
public abstract class WorkflowRequestStoreContract : TenantIsolationContract<IWorkflowRequestStore>, 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;IWorkflowRequestStore&gt;</a> ← <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/">TenantIsolationContract&lt;IWorkflowRequestStore&gt;</a> ← <a href="/api/tracon.testing.contracts.storage.workflowrequeststorecontract/">WorkflowRequestStoreContract</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;IWorkflowRequestStore&gt;.TenantA</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_TenantB">TenantIsolationContract&lt;IWorkflowRequestStore&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;IWorkflowRequestStore&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;IWorkflowRequestStore&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;IWorkflowRequestStore&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;IWorkflowRequestStore&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;IWorkflowRequestStore&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;IWorkflowRequestStore&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;IWorkflowRequestStore&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;IWorkflowRequestStore&gt;.CancellableWriteAsync(CancellationToken)</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_WroteAnythingAsync">TenantIsolationContract&lt;IWorkflowRequestStore&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;IWorkflowRequestStore&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;IWorkflowRequestStore&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;IWorkflowRequestStore&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;IWorkflowRequestStore&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;IWorkflowRequestStore&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;IWorkflowRequestStore&gt;.AmbientTenant</a>, <a href="/api/tracon.testing.contracts.storage.storecancellationcontract-1/#Tracon_Testing_Contracts_Storage_StoreCancellationContract_1_CreateStoreAsync">StoreCancellationContract&lt;IWorkflowRequestStore&gt;.CreateStoreAsync()</a>, <a href="/api/tracon.testing.contracts.storage.storecancellationcontract-1/#Tracon_Testing_Contracts_Storage_StoreCancellationContract_1_InitializeAsync">StoreCancellationContract&lt;IWorkflowRequestStore&gt;.InitializeAsync()</a>, <a href="/api/tracon.testing.contracts.storage.storecancellationcontract-1/#Tracon_Testing_Contracts_Storage_StoreCancellationContract_1_DisposeAsync">StoreCancellationContract&lt;IWorkflowRequestStore&gt;.DisposeAsync()</a>, <a href="/api/tracon.testing.contracts.storage.storecancellationcontract-1/#Tracon_Testing_Contracts_Storage_StoreCancellationContract_1_OnDisposeAsync">StoreCancellationContract&lt;IWorkflowRequestStore&gt;.OnDisposeAsync()</a>, <a href="/api/tracon.testing.contracts.storage.storecancellationcontract-1/#Tracon_Testing_Contracts_Storage_StoreCancellationContract_1_CancellableReadAsync_System_Threading_CancellationToken_">StoreCancellationContract&lt;IWorkflowRequestStore&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;IWorkflowRequestStore&gt;.CancellableWriteAsync(CancellationToken)</a>, <a href="/api/tracon.testing.contracts.storage.storecancellationcontract-1/#Tracon_Testing_Contracts_Storage_StoreCancellationContract_1_WroteAnythingAsync">StoreCancellationContract&lt;IWorkflowRequestStore&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;IWorkflowRequestStore&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;IWorkflowRequestStore&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;IWorkflowRequestStore&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;IWorkflowRequestStore&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 store is the authority of two decisions a unit test of the runner cannot prove: which row
is THE open row of a logical request (the same request id in the same session held by several
runs), and which of an answer and an expiry reaches a row first. The first is a listing
question and the second is a race, so both are cases here.

The [Storage.TenantIsolationContract](/api/tracon.testing.contracts.storage/) hooks are wired to
[IWorkflowRequestStore.AddAsync](/api/tracon.iworkflowrequeststore/#Tracon_IWorkflowRequestStore_AddAsync_System_Collections_Generic_IReadOnlyList_Tracon_WorkflowRequestRecord__System_Threading_CancellationToken_) and [IWorkflowRequestStore.ListAsync](/api/tracon.iworkflowrequeststore/#Tracon_IWorkflowRequestStore_ListAsync_Tracon_WorkflowRequestQuery_System_Threading_CancellationToken_);
the store offers no delete, so another tenant's chance to change a row is
[IWorkflowRequestStore.MarkAnsweredAsync](/api/tracon.iworkflowrequeststore/#Tracon_IWorkflowRequestStore_MarkAnsweredAsync_System_String_System_String_System_Guid_System_DateTimeOffset_System_Threading_CancellationToken_), which has a case of its own.

## Constructors

### <a id="Tracon_Testing_Contracts_Storage_WorkflowRequestStoreContract__ctor"></a> WorkflowRequestStoreContract\(\)

```csharp
protected WorkflowRequestStoreContract()
```

## Methods

### <a id="Tracon_Testing_Contracts_Storage_WorkflowRequestStoreContract_A_closed_row_leaves_the_list_and_cannot_be_marked_answered"></a> A\_closed\_row\_leaves\_the\_list\_and\_cannot\_be\_marked\_answered\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowRequestStoreContract_A_logical_request_stays_listed_while_an_older_run_of_it_closes"></a> A\_logical\_request\_stays\_listed\_while\_an\_older\_run\_of\_it\_closes\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowRequestStoreContract_A_page_outside_the_range_is_cut_to_it"></a> A\_page\_outside\_the\_range\_is\_cut\_to\_it\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowRequestStoreContract_A_row_expires_at_its_time_and_not_before"></a> A\_row\_expires\_at\_its\_time\_and\_not\_before\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowRequestStoreContract_A_row_is_closed_once"></a> A\_row\_is\_closed\_once\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowRequestStoreContract_A_row_without_a_time_limit_reads_back_without_one"></a> A\_row\_without\_a\_time\_limit\_reads\_back\_without\_one\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowRequestStoreContract_A_run_lists_its_requests_in_event_order"></a> A\_run\_lists\_its\_requests\_in\_event\_order\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowRequestStoreContract_A_run_that_is_closed_or_has_an_open_row_is_not_stranded"></a> A\_run\_that\_is\_closed\_or\_has\_an\_open\_row\_is\_not\_stranded\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowRequestStoreContract_A_run_that_still_waits_after_its_last_row_closed_is_listed_as_stranded"></a> A\_run\_that\_still\_waits\_after\_its\_last\_row\_closed\_is\_listed\_as\_stranded\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowRequestStoreContract_A_second_answer_names_its_own_run_and_keeps_the_first_time"></a> A\_second\_answer\_names\_its\_own\_run\_and\_keeps\_the\_first\_time\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowRequestStoreContract_A_written_row_is_read_back_with_every_field"></a> A\_written\_row\_is\_read\_back\_with\_every\_field\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowRequestStoreContract_Another_tenant_cannot_mark_a_row_answered"></a> Another\_tenant\_cannot\_mark\_a\_row\_answered\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowRequestStoreContract_Concurrent_expiries_close_each_row_exactly_once"></a> Concurrent\_expiries\_close\_each\_row\_exactly\_once\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowRequestStoreContract_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_WorkflowRequestStoreContract_EraseRunAsync_System_Guid_System_String_"></a> EraseRunAsync\(Guid, string\)

Erases a run the way a data subject erasure does.

```csharp
protected virtual ValueTask<bool> EraseRunAsync(Guid runId, string tenantId)
```

#### Parameters

`runId` [Guid](https://learn.microsoft.com/dotnet/api/system.guid)

The run to erase.

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

#### 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) when the run was erased; [false](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool) when the store
under test has no run table to erase from, and the case does not apply.

### <a id="Tracon_Testing_Contracts_Storage_WorkflowRequestStoreContract_Erasing_the_run_removes_its_rows"></a> Erasing\_the\_run\_removes\_its\_rows\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowRequestStoreContract_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_WorkflowRequestStoreContract_Expiry_closes_only_the_open_rows_whose_time_has_come_and_returns_them"></a> Expiry\_closes\_only\_the\_open\_rows\_whose\_time\_has\_come\_and\_returns\_them\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowRequestStoreContract_Expiry_closes_the_oldest_deadlines_first_and_no_more_than_max"></a> Expiry\_closes\_the\_oldest\_deadlines\_first\_and\_no\_more\_than\_max\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowRequestStoreContract_Expiry_closes_the_rows_of_every_tenant_and_keeps_the_answer_mark"></a> Expiry\_closes\_the\_rows\_of\_every\_tenant\_and\_keeps\_the\_answer\_mark\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowRequestStoreContract_Marking_answered_marks_every_open_row_of_the_logical_request_and_no_other"></a> Marking\_answered\_marks\_every\_open\_row\_of\_the\_logical\_request\_and\_no\_other\(\)

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

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

Opens the run row an inbox row points at.

```csharp
protected virtual ValueTask PrepareRunAsync(Guid runId, string tenantId, string sessionId)
```

#### Parameters

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

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

`sessionId` [string](https://learn.microsoft.com/dotnet/api/system.string)

The run's execution session.

#### Returns

 [ValueTask](https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask)

The completion task.

#### Remarks

In the SQL implementations `workflow_requests.run_id` is a foreign key into
`runs`; the in-memory implementation has no such link, and the hook does nothing.

### <a id="Tracon_Testing_Contracts_Storage_WorkflowRequestStoreContract_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_WorkflowRequestStoreContract_SetRunStatusAsync_System_Guid_System_String_Tracon_RunStatus_"></a> SetRunStatusAsync\(Guid, string, RunStatus\)

Gives a run the status a run has when it stops waiting, or starts to.

```csharp
protected virtual ValueTask<bool> SetRunStatusAsync(Guid runId, string tenantId, RunStatus status)
```

#### Parameters

`runId` [Guid](https://learn.microsoft.com/dotnet/api/system.guid)

The run, opened by [WorkflowRequestStoreContract.PrepareRunAsync](/api/tracon.testing.contracts.storage.workflowrequeststorecontract/#Tracon_Testing_Contracts_Storage_WorkflowRequestStoreContract_PrepareRunAsync_System_Guid_System_String_System_String_).

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

`status` [RunStatus](/api/tracon.runstatus/)

The status to give.

#### 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) when the run now has the status; [false](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool) when the
store under test has no run table, and the cases that need a waiting run do not apply.

### <a id="Tracon_Testing_Contracts_Storage_WorkflowRequestStoreContract_Stranded_runs_are_listed_oldest_closure_first_and_no_more_than_max"></a> Stranded\_runs\_are\_listed\_oldest\_closure\_first\_and\_no\_more\_than\_max\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowRequestStoreContract_The_list_can_be_limited_to_one_workflow"></a> The\_list\_can\_be\_limited\_to\_one\_workflow\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowRequestStoreContract_The_list_is_oldest_first_and_pages_without_gaps_or_repeats"></a> The\_list\_is\_oldest\_first\_and\_pages\_without\_gaps\_or\_repeats\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowRequestStoreContract_The_same_request_id_in_two_sessions_is_two_requests"></a> The\_same\_request\_id\_in\_two\_sessions\_is\_two\_requests\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowRequestStoreContract_The_same_request_of_a_session_is_listed_once_under_its_newest_open_run"></a> The\_same\_request\_of\_a\_session\_is\_listed\_once\_under\_its\_newest\_open\_run\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowRequestStoreContract_The_state_filter_runs_before_the_page_so_a_page_is_never_short"></a> The\_state\_filter\_runs\_before\_the\_page\_so\_a\_page\_is\_never\_short\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowRequestStoreContract_Two_tenants_hold_the_same_session_and_request_without_seeing_each_other"></a> Two\_tenants\_hold\_the\_same\_session\_and\_request\_without\_seeing\_each\_other\(\)

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

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowRequestStoreContract_Writing_the_same_run_and_request_twice_keeps_the_first_row"></a> Writing\_the\_same\_run\_and\_request\_twice\_keeps\_the\_first\_row\(\)

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

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