OptimisticConcurrencyTestBase<TTestStore, TFixture> OptimisticConcurrencyTestBase(Of TTestStore, TFixture) Class

Definition

public abstract class OptimisticConcurrencyTestBase<TTestStore, TFixture> : IClassFixture<TFixture>, IDisposable where TTestStore : TestStore where TFixture : F1FixtureBase<TTestStore>, new ()
Public MustInherit Class OptimisticConcurrencyTestBase(Of TTestStore As TestStore, TFixture As {F1FixtureBase(Of TTestStore), New})
    Inherits IClassFixture(Of TFixture)
    Implements IDisposable
Type Parameters
TTestStore
TFixture
Inheritance
System.ObjectSystem.Object
OptimisticConcurrencyTestBase<TTestStore, TFixture>OptimisticConcurrencyTestBase(Of TTestStore, TFixture)
Implements
System.IDisposableSystem.IDisposable

Constructors

OptimisticConcurrencyTestBase(TFixture) OptimisticConcurrencyTestBase(TFixture)

protected OptimisticConcurrencyTestBase(TFixture fixture)
Protected Sub New(fixture As TFixture)
Parameters
fixture
TFixture TFixture

Fields

ClientPodiums ClientPodiums

protected const int ClientPodiums = 30
Protected Const ClientPodiums As Integer = 30

StorePodiums StorePodiums

protected const int StorePodiums = 20
Protected Const StorePodiums As Integer = 20

Properties

Fixture Fixture

protected TFixture Fixture { get; }
Protected ReadOnly Property Fixture As TFixture
Value
TFixture TFixture

TestStore TestStore

protected TTestStore TestStore { get; }
Protected ReadOnly Property TestStore As TTestStore
Value
TTestStore TTestStore

Methods

Adding_the_same_entity_twice_results_in_DbUpdateException() Adding_the_same_entity_twice_results_in_DbUpdateException()

public virtual Task Adding_the_same_entity_twice_results_in_DbUpdateException()
Public Overridable Function Adding_the_same_entity_twice_results_in_DbUpdateException As Task
Returns
System.Threading.Tasks.Task System.Threading.Tasks.Task

Attempting_to_add_same_relationship_twice_for_many_to_many_results_in_independent_association_exception() Attempting_to_add_same_relationship_twice_for_many_to_many_results_in_independent_association_exception()

public virtual Task Attempting_to_add_same_relationship_twice_for_many_to_many_results_in_independent_association_exception()
Public Overridable Function Attempting_to_add_same_relationship_twice_for_many_to_many_results_in_independent_association_exception As Task
Returns
System.Threading.Tasks.Task System.Threading.Tasks.Task

Attempting_to_delete_same_relationship_twice_for_many_to_many_results_in_independent_association_exception() Attempting_to_delete_same_relationship_twice_for_many_to_many_results_in_independent_association_exception()

public virtual Task Attempting_to_delete_same_relationship_twice_for_many_to_many_results_in_independent_association_exception()
Public Overridable Function Attempting_to_delete_same_relationship_twice_for_many_to_many_results_in_independent_association_exception As Task
Returns
System.Threading.Tasks.Task System.Threading.Tasks.Task

Calling_Reload_on_a_Deleted_entity_makes_the_entity_unchanged(Boolean) Calling_Reload_on_a_Deleted_entity_makes_the_entity_unchanged(Boolean)

public virtual Task Calling_Reload_on_a_Deleted_entity_makes_the_entity_unchanged(bool async)
Public Overridable Function Calling_Reload_on_a_Deleted_entity_makes_the_entity_unchanged(async As Boolean) As Task
Parameters
async
System.Boolean System.Boolean
Returns
System.Threading.Tasks.Task System.Threading.Tasks.Task

Calling_Reload_on_a_Deleted_entity_that_is_not_in_database_detaches_it(Boolean) Calling_Reload_on_a_Deleted_entity_that_is_not_in_database_detaches_it(Boolean)

public virtual Task Calling_Reload_on_a_Deleted_entity_that_is_not_in_database_detaches_it(bool async)
Public Overridable Function Calling_Reload_on_a_Deleted_entity_that_is_not_in_database_detaches_it(async As Boolean) As Task
Parameters
async
System.Boolean System.Boolean
Returns
System.Threading.Tasks.Task System.Threading.Tasks.Task

Calling_Reload_on_a_Detached_entity_makes_the_entity_unchanged(Boolean) Calling_Reload_on_a_Detached_entity_makes_the_entity_unchanged(Boolean)

public virtual Task Calling_Reload_on_a_Detached_entity_makes_the_entity_unchanged(bool async)
Public Overridable Function Calling_Reload_on_a_Detached_entity_makes_the_entity_unchanged(async As Boolean) As Task
Parameters
async
System.Boolean System.Boolean
Returns
System.Threading.Tasks.Task System.Threading.Tasks.Task

Calling_Reload_on_a_Detached_entity_that_is_not_in_database_detaches_it(Boolean) Calling_Reload_on_a_Detached_entity_that_is_not_in_database_detaches_it(Boolean)

public virtual Task Calling_Reload_on_a_Detached_entity_that_is_not_in_database_detaches_it(bool async)
Public Overridable Function Calling_Reload_on_a_Detached_entity_that_is_not_in_database_detaches_it(async As Boolean) As Task
Parameters
async
System.Boolean System.Boolean
Returns
System.Threading.Tasks.Task System.Threading.Tasks.Task

Calling_Reload_on_a_Modified_entity_makes_the_entity_unchanged(Boolean) Calling_Reload_on_a_Modified_entity_makes_the_entity_unchanged(Boolean)

public virtual Task Calling_Reload_on_a_Modified_entity_makes_the_entity_unchanged(bool async)
Public Overridable Function Calling_Reload_on_a_Modified_entity_makes_the_entity_unchanged(async As Boolean) As Task
Parameters
async
System.Boolean System.Boolean
Returns
System.Threading.Tasks.Task System.Threading.Tasks.Task

Calling_Reload_on_a_Modified_entity_that_is_not_in_database_detaches_it(Boolean) Calling_Reload_on_a_Modified_entity_that_is_not_in_database_detaches_it(Boolean)

public virtual Task Calling_Reload_on_a_Modified_entity_that_is_not_in_database_detaches_it(bool async)
Public Overridable Function Calling_Reload_on_a_Modified_entity_that_is_not_in_database_detaches_it(async As Boolean) As Task
Parameters
async
System.Boolean System.Boolean
Returns
System.Threading.Tasks.Task System.Threading.Tasks.Task

Calling_Reload_on_an__Added_entity_that_is_not_in_database_is_no_op(Boolean) Calling_Reload_on_an__Added_entity_that_is_not_in_database_is_no_op(Boolean)

public virtual Task Calling_Reload_on_an__Added_entity_that_is_not_in_database_is_no_op(bool async)
Public Overridable Function Calling_Reload_on_an__Added_entity_that_is_not_in_database_is_no_op(async As Boolean) As Task
Parameters
async
System.Boolean System.Boolean
Returns
System.Threading.Tasks.Task System.Threading.Tasks.Task

Calling_Reload_on_an_Added_entity_that_was_saved_elsewhere_makes_the_entity_unchanged(Boolean) Calling_Reload_on_an_Added_entity_that_was_saved_elsewhere_makes_the_entity_unchanged(Boolean)

public virtual Task Calling_Reload_on_an_Added_entity_that_was_saved_elsewhere_makes_the_entity_unchanged(bool async)
Public Overridable Function Calling_Reload_on_an_Added_entity_that_was_saved_elsewhere_makes_the_entity_unchanged(async As Boolean) As Task
Parameters
async
System.Boolean System.Boolean
Returns
System.Threading.Tasks.Task System.Threading.Tasks.Task

Calling_Reload_on_an_Unchanged_entity_makes_the_entity_unchanged(Boolean) Calling_Reload_on_an_Unchanged_entity_makes_the_entity_unchanged(Boolean)

public virtual Task Calling_Reload_on_an_Unchanged_entity_makes_the_entity_unchanged(bool async)
Public Overridable Function Calling_Reload_on_an_Unchanged_entity_makes_the_entity_unchanged(async As Boolean) As Task
Parameters
async
System.Boolean System.Boolean
Returns
System.Threading.Tasks.Task System.Threading.Tasks.Task

Calling_Reload_on_an_Unchanged_entity_that_is_not_in_database_detaches_it(Boolean) Calling_Reload_on_an_Unchanged_entity_that_is_not_in_database_detaches_it(Boolean)

public virtual Task Calling_Reload_on_an_Unchanged_entity_that_is_not_in_database_detaches_it(bool async)
Public Overridable Function Calling_Reload_on_an_Unchanged_entity_that_is_not_in_database_detaches_it(async As Boolean) As Task
Parameters
async
System.Boolean System.Boolean
Returns
System.Threading.Tasks.Task System.Threading.Tasks.Task

Change_in_independent_association_after_change_in_different_concurrency_token_results_in_independent_association_exception() Change_in_independent_association_after_change_in_different_concurrency_token_results_in_independent_association_exception()

public virtual Task Change_in_independent_association_after_change_in_different_concurrency_token_results_in_independent_association_exception()
Public Overridable Function Change_in_independent_association_after_change_in_different_concurrency_token_results_in_independent_association_exception As Task
Returns
System.Threading.Tasks.Task System.Threading.Tasks.Task

Change_in_independent_association_results_in_independent_association_exception() Change_in_independent_association_results_in_independent_association_exception()

public virtual Task Change_in_independent_association_results_in_independent_association_exception()
Public Overridable Function Change_in_independent_association_results_in_independent_association_exception As Task
Returns
System.Threading.Tasks.Task System.Threading.Tasks.Task

Concurrency_issue_where_a_complex_type_nested_member_is_the_concurrency_token_can_be_handled() Concurrency_issue_where_a_complex_type_nested_member_is_the_concurrency_token_can_be_handled()

public virtual Task Concurrency_issue_where_a_complex_type_nested_member_is_the_concurrency_token_can_be_handled()
Public Overridable Function Concurrency_issue_where_a_complex_type_nested_member_is_the_concurrency_token_can_be_handled As Task
Returns
System.Threading.Tasks.Task System.Threading.Tasks.Task

Concurrency_issue_where_the_FK_is_the_concurrency_token_can_be_handled() Concurrency_issue_where_the_FK_is_the_concurrency_token_can_be_handled()

public virtual Task Concurrency_issue_where_the_FK_is_the_concurrency_token_can_be_handled()
Public Overridable Function Concurrency_issue_where_the_FK_is_the_concurrency_token_can_be_handled As Task
Returns
System.Threading.Tasks.Task System.Threading.Tasks.Task

ConcurrencyTestAsync(Action, Action, Action, Action) ConcurrencyTestAsync(Action(Of F1Context), Action(Of F1Context), Action(Of F1Context, DbUpdateException), Action(Of F1Context))

Runs the two actions with two different contexts and calling SaveChanges such that storeChange will succeed and the store will reflect this change, and then clientChange will result in a concurrency exception. After the exception is caught the resolver action is called, after which SaveChanges is called again. Finally, a new context is created and the validator is called so that the state of the database at the end of the process can be validated.

protected virtual Task ConcurrencyTestAsync(Action<F1Context> storeChange, Action<F1Context> clientChange, Action<F1Context, DbUpdateException> resolver, Action<F1Context> validator)
Protected Overridable Function ConcurrencyTestAsync(storeChange As Action(Of F1Context), clientChange As Action(Of F1Context), resolver As Action(Of F1Context, DbUpdateException), validator As Action(Of F1Context)) As Task
Parameters
storeChange
System.Action<F1Context> System.Action(Of F1Context)
clientChange
System.Action<F1Context> System.Action(Of F1Context)
resolver
System.Action<F1Context, DbUpdateException> System.Action(Of F1Context, DbUpdateException)
validator
System.Action<F1Context> System.Action(Of F1Context)
Returns
System.Threading.Tasks.Task System.Threading.Tasks.Task

CreateF1Context() CreateF1Context()

protected F1Context CreateF1Context()
Protected Function CreateF1Context As F1Context
Returns

Deleting_the_same_entity_twice_results_in_DbUpdateConcurrencyException() Deleting_the_same_entity_twice_results_in_DbUpdateConcurrencyException()

public virtual Task Deleting_the_same_entity_twice_results_in_DbUpdateConcurrencyException()
Public Overridable Function Deleting_the_same_entity_twice_results_in_DbUpdateConcurrencyException As Task
Returns
System.Threading.Tasks.Task System.Threading.Tasks.Task

Deleting_then_updating_the_same_entity_results_in_DbUpdateConcurrencyException() Deleting_then_updating_the_same_entity_results_in_DbUpdateConcurrencyException()

public virtual Task Deleting_then_updating_the_same_entity_results_in_DbUpdateConcurrencyException()
Public Overridable Function Deleting_then_updating_the_same_entity_results_in_DbUpdateConcurrencyException As Task
Returns
System.Threading.Tasks.Task System.Threading.Tasks.Task

Deleting_then_updating_the_same_entity_results_in_DbUpdateConcurrencyException_which_can_be_resolved_with_store_values() Deleting_then_updating_the_same_entity_results_in_DbUpdateConcurrencyException_which_can_be_resolved_with_store_values()

public virtual Task Deleting_then_updating_the_same_entity_results_in_DbUpdateConcurrencyException_which_can_be_resolved_with_store_values()
Public Overridable Function Deleting_then_updating_the_same_entity_results_in_DbUpdateConcurrencyException_which_can_be_resolved_with_store_values As Task
Returns
System.Threading.Tasks.Task System.Threading.Tasks.Task

Dispose() Dispose()

public void Dispose()
Public Sub Dispose

Nullable_client_side_concurrency_token_can_be_used() Nullable_client_side_concurrency_token_can_be_used()

public virtual void Nullable_client_side_concurrency_token_can_be_used()
Public Overridable Sub Nullable_client_side_concurrency_token_can_be_used

ResolveConcurrencyTokens(EntityEntry) ResolveConcurrencyTokens(EntityEntry)

protected virtual void ResolveConcurrencyTokens(EntityEntry entry)
Protected Overridable Sub ResolveConcurrencyTokens(entry As EntityEntry)
Parameters

Simple_concurrency_exception_can_be_resolved_with_client_values() Simple_concurrency_exception_can_be_resolved_with_client_values()

public virtual Task Simple_concurrency_exception_can_be_resolved_with_client_values()
Public Overridable Function Simple_concurrency_exception_can_be_resolved_with_client_values As Task
Returns
System.Threading.Tasks.Task System.Threading.Tasks.Task

Simple_concurrency_exception_can_be_resolved_with_new_values() Simple_concurrency_exception_can_be_resolved_with_new_values()

public virtual Task Simple_concurrency_exception_can_be_resolved_with_new_values()
Public Overridable Function Simple_concurrency_exception_can_be_resolved_with_new_values As Task
Returns
System.Threading.Tasks.Task System.Threading.Tasks.Task

Simple_concurrency_exception_can_be_resolved_with_store_values() Simple_concurrency_exception_can_be_resolved_with_store_values()

public virtual Task Simple_concurrency_exception_can_be_resolved_with_store_values()
Public Overridable Function Simple_concurrency_exception_can_be_resolved_with_store_values As Task
Returns
System.Threading.Tasks.Task System.Threading.Tasks.Task

Simple_concurrency_exception_can_be_resolved_with_store_values_using_equivalent_of_accept_changes() Simple_concurrency_exception_can_be_resolved_with_store_values_using_equivalent_of_accept_changes()

public virtual Task Simple_concurrency_exception_can_be_resolved_with_store_values_using_equivalent_of_accept_changes()
Public Overridable Function Simple_concurrency_exception_can_be_resolved_with_store_values_using_equivalent_of_accept_changes As Task
Returns
System.Threading.Tasks.Task System.Threading.Tasks.Task

Simple_concurrency_exception_can_be_resolved_with_store_values_using_Reload() Simple_concurrency_exception_can_be_resolved_with_store_values_using_Reload()

public virtual Task Simple_concurrency_exception_can_be_resolved_with_store_values_using_Reload()
Public Overridable Function Simple_concurrency_exception_can_be_resolved_with_store_values_using_Reload As Task
Returns
System.Threading.Tasks.Task System.Threading.Tasks.Task

Two_concurrency_issues_in_one_to_many_related_entities_can_be_handled_by_dealing_with_dependent_first() Two_concurrency_issues_in_one_to_many_related_entities_can_be_handled_by_dealing_with_dependent_first()

public virtual Task Two_concurrency_issues_in_one_to_many_related_entities_can_be_handled_by_dealing_with_dependent_first()
Public Overridable Function Two_concurrency_issues_in_one_to_many_related_entities_can_be_handled_by_dealing_with_dependent_first As Task
Returns
System.Threading.Tasks.Task System.Threading.Tasks.Task

Two_concurrency_issues_in_one_to_one_related_entities_can_be_handled_by_dealing_with_dependent_first() Two_concurrency_issues_in_one_to_one_related_entities_can_be_handled_by_dealing_with_dependent_first()

public virtual Task Two_concurrency_issues_in_one_to_one_related_entities_can_be_handled_by_dealing_with_dependent_first()
Public Overridable Function Two_concurrency_issues_in_one_to_one_related_entities_can_be_handled_by_dealing_with_dependent_first As Task
Returns
System.Threading.Tasks.Task System.Threading.Tasks.Task

Updating_then_deleting_the_same_entity_results_in_DbUpdateConcurrencyException() Updating_then_deleting_the_same_entity_results_in_DbUpdateConcurrencyException()

public virtual Task Updating_then_deleting_the_same_entity_results_in_DbUpdateConcurrencyException()
Public Overridable Function Updating_then_deleting_the_same_entity_results_in_DbUpdateConcurrencyException As Task
Returns
System.Threading.Tasks.Task System.Threading.Tasks.Task

Updating_then_deleting_the_same_entity_results_in_DbUpdateConcurrencyException_which_can_be_resolved_with_store_values() Updating_then_deleting_the_same_entity_results_in_DbUpdateConcurrencyException_which_can_be_resolved_with_store_values()

public virtual Task Updating_then_deleting_the_same_entity_results_in_DbUpdateConcurrencyException_which_can_be_resolved_with_store_values()
Public Overridable Function Updating_then_deleting_the_same_entity_results_in_DbUpdateConcurrencyException_which_can_be_resolved_with_store_values As Task
Returns
System.Threading.Tasks.Task System.Threading.Tasks.Task

UseTransaction(DatabaseFacade, IDbContextTransaction) UseTransaction(DatabaseFacade, IDbContextTransaction)

protected virtual void UseTransaction(DatabaseFacade facade, IDbContextTransaction transaction)
Protected Overridable Sub UseTransaction(facade As DatabaseFacade, transaction As IDbContextTransaction)
Parameters