diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json
new file mode 100644
index 00000000..118ed0a7
--- /dev/null
+++ b/.config/dotnet-tools.json
@@ -0,0 +1,12 @@
+{
+ "version": 1,
+ "isRoot": true,
+ "tools":{
+ "csharpasyncgenerator.tool": {
+ "version": "0.21.1",
+ "commands": [
+ "async-generator"
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/.github/workflows/GenerateAsyncCode.yml b/.github/workflows/GenerateAsyncCode.yml
new file mode 100644
index 00000000..6fe2918a
--- /dev/null
+++ b/.github/workflows/GenerateAsyncCode.yml
@@ -0,0 +1,44 @@
+name: Generate Async code
+
+on:
+ pull_request_target:
+ paths:
+ - '**.cs'
+
+permissions: {}
+
+jobs:
+ generate-async:
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v3
+ with:
+ ref: ${{ github.event.pull_request.head.ref }}
+ repository: ${{ github.event.pull_request.head.repo.full_name }}
+ token: ${{ secrets.NHIBERNATE_BOT_TOKEN }}
+
+ - name: Setup .NET
+ uses: actions/setup-dotnet@v3
+ with:
+ dotnet-version: 6.0.x
+
+ - name: Generate Async code
+ run: |
+ pushd Src
+ dotnet tool restore
+ dotnet restore ./Envers.sln
+ dotnet async-generator
+ popd
+
+ - name: Push changes
+ run: |
+ git config user.name github-actions[bot]
+ git config user.email github-actions[bot]@users.noreply.github.com
+ if [[ -z "$(git status --porcelain)" ]]; then
+ echo "No changes to commit"
+ exit 0
+ fi
+ git add -A
+ git commit -am "Generate async files"
+ git push
diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml
index 9341600e..2785099b 100644
--- a/.github/workflows/dotnet.yml
+++ b/.github/workflows/dotnet.yml
@@ -23,7 +23,7 @@ jobs:
- db: MySQL
connectionstring: "Server=localhost;Uid=root;Password=envers;Database=envers;SslMode=none;"
dialect: "NHibernate.Dialect.MySQL8InnoDBDialect"
- driverclass: "NHibernate.Driver.MySqlDataDriver"
+ driverclass: "NHibernate.Driver.MySqlConnector.MySqlConnectorDriver, NHibernate.Driver.MySqlConnector"
- db: Oracle
connectionstring: "User ID=envers;Password=envers;Metadata Pooling=false;Self Tuning=false;Data Source=(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = XEPDB1)))"
dialect: "NHibernate.Dialect.Oracle10gDialect"
@@ -47,7 +47,7 @@ jobs:
if: matrix.db == 'MySQL'
run: |
sudo service mysql stop
- docker run --name mysql --tmpfs /var/lib/mysql:rw,noexec,nosuid,size=256m -e MYSQL_ROOT_PASSWORD=envers -e MYSQL_USER=envers -e MYSQL_PASSWORD=envers -e MYSQL_DATABASE=envers -p 3306:3306 --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 -d mysql:8.0 mysqld --lower_case_table_names=1 --skip-ssl --default_authentication_plugin=mysql_native_password
+ docker run --name mysql --tmpfs /var/lib/mysql:rw,noexec,nosuid,size=1024m -e MYSQL_ROOT_PASSWORD=envers -e MYSQL_USER=envers -e MYSQL_PASSWORD=envers -e MYSQL_DATABASE=envers -p 3306:3306 --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 -d mysql:8.0 mysqld --lower_case_table_names=1 --skip-ssl --default_authentication_plugin=mysql_native_password
- name: Set up Oracle
if: matrix.db == 'Oracle'
run: |
diff --git a/Src/AsyncGenerator.yml b/Src/AsyncGenerator.yml
new file mode 100644
index 00000000..e59a1cf2
--- /dev/null
+++ b/Src/AsyncGenerator.yml
@@ -0,0 +1,73 @@
+projects:
+- filePath: NHibernate.Envers\NHibernate.Envers.csproj
+ targetFramework: netcoreapp2.0
+ concurrentRun: true
+ applyChanges: true
+ analyzation:
+ methodConversion:
+ - conversion: ToAsync
+ name: Results
+ containingTypeName: IEntityAuditQuery
+ - conversion: ToAsync
+ name: BuildAndExecuteQuery
+ containingTypeName: AbstractRevisionsQuery
+ - conversion: ToAsync
+ name: Results
+ containingTypeName: AllEntitiesAtRevisionQuery
+ - conversion: Ignore
+ containingTypeName: IPropertyMapper
+ - conversion: Ignore
+ containingTypeName: CollectionProxy
+ typeConversion:
+ - conversion: Ignore
+ name: Toolz
+ callForwarding: true
+ cancellationTokens:
+ guards: true
+ methodParameter:
+ - parameter: Optional
+ requiresCancellationToken:
+ - containingTypeName: IEntityAuditQuery
+ scanMethodBody: true
+ searchAsyncCounterpartsInInheritedTypes: true
+ scanForMissingAsyncMembers:
+ - all: true
+ alwaysAwait:
+ - all: true
+ transformation:
+ configureAwaitArgument: false
+ localFunctions: true
+ registerPlugin:
+ - type: AsyncGenerator.Core.Plugins.EmptyRegionRemover
+ assemblyName: AsyncGenerator.Core
+- filePath: NHibernate.Envers.Tests\NHibernate.Envers.Tests.csproj
+ targetFramework: net6.0
+ concurrentRun: true
+ applyChanges: true
+ analyzation:
+ callForwarding: true
+ cancellationTokens:
+ enabled: true
+ scanMethodBody: true
+ searchAsyncCounterpartsInInheritedTypes: true
+ scanForMissingAsyncMembers:
+ - all: true
+ methodConversion:
+ - conversion: Ignore
+ name: Initialize
+ containingTypeName: OneStrategyTestBase
+ transformation:
+ configureAwaitArgument: false
+ localFunctions: true
+ registerPlugin:
+ - type: AsyncGenerator.Core.Plugins.NUnitPlugin
+ parameters:
+ - name: createNewTypes
+ value: false
+ assemblyName: AsyncGenerator.Core
+ - type: AsyncGenerator.Core.Plugins.TransactionScopeAsyncFlowAdder
+ assemblyName: AsyncGenerator.Core
+methodRules:
+ - filters:
+ - containingType: NHibernate.Envers.Synchronization.transactionCompletionProcess
+ name: TransactionCompletion
\ No newline at end of file
diff --git a/Src/Build/default.msbuild b/Src/Build/default.msbuild
index eb40c949..46340bc8 100644
--- a/Src/Build/default.msbuild
+++ b/Src/Build/default.msbuild
@@ -20,7 +20,7 @@
-
+
@@ -37,6 +37,10 @@
+
+
+
+
diff --git a/Src/Envers.sln b/Src/Envers.sln
index 29bc7e5b..32a28947 100644
--- a/Src/Envers.sln
+++ b/Src/Envers.sln
@@ -1,15 +1,17 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.27428.2015
+# Visual Studio Version 17
+VisualStudioVersion = 17.7.34031.279
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{34BA8295-3EBE-47B0-ABBF-0A7E9A8E6B35}"
ProjectSection(SolutionItems) = preProject
+ AsyncGenerator.yml = AsyncGenerator.yml
Build\buildDoc.bat = Build\buildDoc.bat
Build\buildRelease.bat = Build\buildRelease.bat
Build\default.msbuild = Build\default.msbuild
- ReleaseNotes.txt = ReleaseNotes.txt
..\.github\workflows\dotnet.yml = ..\.github\workflows\dotnet.yml
+ ..\.github\workflows\GenerateAsyncCode.yml = ..\.github\workflows\GenerateAsyncCode.yml
+ ReleaseNotes.txt = ReleaseNotes.txt
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Doc", "Doc", "{C9C74EFE-506E-41A8-8359-88AB303E60DA}"
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/AccessType/FieldAccessTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/AccessType/FieldAccessTest.cs
new file mode 100644
index 00000000..0db0fa96
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/AccessType/FieldAccessTest.cs
@@ -0,0 +1,37 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using NUnit.Framework;
+
+namespace NHibernate.Envers.Tests.Integration.AccessType
+{
+ using System.Threading.Tasks;
+ public partial class FieldAccessTest : TestBase
+ {
+
+ [Test]
+ public async Task VerifyRevisionCountAsync()
+ {
+ CollectionAssert.AreEquivalent(new[] { 1, 2 }, await (AuditReader().GetRevisionsAsync(typeof(FieldAccessEntity), id)).ConfigureAwait(false));
+ }
+
+ [Test]
+ public async Task VerifyHistoryAsync()
+ {
+ var ver1 = new FieldAccessEntity { Id = id };
+ ver1.SetData("first");
+ var ver2 = new FieldAccessEntity { Id = id };
+ ver2.SetData("second");
+
+ Assert.AreEqual(ver1, await (AuditReader().FindAsync(id, 1)).ConfigureAwait(false));
+ Assert.AreEqual(ver2, await (AuditReader().FindAsync(id, 2)).ConfigureAwait(false));
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/AccessType/ImmutableClassAccessTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/AccessType/ImmutableClassAccessTest.cs
new file mode 100644
index 00000000..611591ce
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/AccessType/ImmutableClassAccessTest.cs
@@ -0,0 +1,35 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using NUnit.Framework;
+
+namespace NHibernate.Envers.Tests.Integration.AccessType
+{
+ using System.Threading.Tasks;
+ public partial class ImmutableClassAccessTest : TestBase
+ {
+
+ [Test]
+ public async Task VerifyRevisionCountAsync()
+ {
+ CollectionAssert.AreEquivalent(new[] { 1 }, await (AuditReader().GetRevisionsAsync(typeof(Country), country.Code)).ConfigureAwait(false));
+ }
+
+ [Test]
+ public async Task VerifyHistoryAsync()
+ {
+ var country1 = await (Session.GetAsync(country.Code)).ConfigureAwait(false);
+ Assert.AreEqual(country, country1);
+
+ var history = await (AuditReader().FindAsync(country1.Code, 1)).ConfigureAwait(false);
+ Assert.AreEqual(country, history);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/AccessType/MixedAccessTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/AccessType/MixedAccessTest.cs
new file mode 100644
index 00000000..8817f4e6
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/AccessType/MixedAccessTest.cs
@@ -0,0 +1,41 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using NUnit.Framework;
+
+namespace NHibernate.Envers.Tests.Integration.AccessType
+{
+ using System.Threading.Tasks;
+ public partial class MixedAccessTest : TestBase
+ {
+
+ [Test]
+ public async Task VerifyRevisionCountAsync()
+ {
+ CollectionAssert.AreEquivalent(new[] { 1, 2 }, await (AuditReader().GetRevisionsAsync(typeof(MixedAccessEntity), id1)).ConfigureAwait(false));
+ }
+
+ [Test]
+ public async Task VerifyHistoryAsync()
+ {
+ var ver1 = new MixedAccessEntity(id1, "data");
+ var ver2 = new MixedAccessEntity(id1, "data2");
+
+ var rev1 = await (AuditReader().FindAsync(id1, 1)).ConfigureAwait(false);
+ var rev2 = await (AuditReader().FindAsync(id1, 2)).ConfigureAwait(false);
+
+ Assert.IsTrue(rev1.IsDataSet);
+ Assert.IsTrue(rev2.IsDataSet);
+
+ Assert.AreEqual(ver1, rev1);
+ Assert.AreEqual(ver2, rev2);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/AccessType/NoSetterTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/AccessType/NoSetterTest.cs
new file mode 100644
index 00000000..68f9eaf3
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/AccessType/NoSetterTest.cs
@@ -0,0 +1,35 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using NUnit.Framework;
+
+namespace NHibernate.Envers.Tests.Integration.AccessType
+{
+ using System.Threading.Tasks;
+ public partial class NoSetterTest : TestBase
+ {
+
+ [Test]
+ public async Task VerifyRevisionCountAsync()
+ {
+ CollectionAssert.AreEquivalent(new[] { 1, 2 }, await (AuditReader().GetRevisionsAsync(typeof(NoSetterEntity), id1)).ConfigureAwait(false));
+ }
+
+ [Test]
+ public async Task VerifyHistoryAsync()
+ {
+ var rev1 = await (AuditReader().FindAsync(id1, 1)).ConfigureAwait(false);
+ var rev2 = await (AuditReader().FindAsync(id1, 2)).ConfigureAwait(false);
+
+ Assert.AreEqual("data", rev1.Data);
+ Assert.AreEqual("data2", rev2.Data);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/AccessType/PropertyAccessTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/AccessType/PropertyAccessTest.cs
new file mode 100644
index 00000000..45cb0d5a
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/AccessType/PropertyAccessTest.cs
@@ -0,0 +1,32 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using NUnit.Framework;
+
+namespace NHibernate.Envers.Tests.Integration.AccessType
+{
+ using System.Threading.Tasks;
+ public partial class PropertyAccessTest : TestBase
+ {
+
+ [Test]
+ public async Task VerifyRevisionCountAsync()
+ {
+ CollectionAssert.AreEquivalent(new[] { 1, 2 }, await (AuditReader().GetRevisionsAsync(typeof(PropertyAccessEntity), id)).ConfigureAwait(false));
+ }
+
+ [Test]
+ public async Task VerifyHistoryAsync()
+ {
+ Assert.AreEqual("first", (await (AuditReader().FindAsync(id, 1)).ConfigureAwait(false)).Data);
+ Assert.AreEqual("second", (await (AuditReader().FindAsync(id, 2)).ConfigureAwait(false)).Data);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/AuditReader/AuditReaderAPITest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/AuditReader/AuditReaderAPITest.cs
new file mode 100644
index 00000000..d2d22396
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/AuditReader/AuditReaderAPITest.cs
@@ -0,0 +1,32 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using NHibernate.Envers.Exceptions;
+using NUnit.Framework;
+using SharpTestsEx;
+
+namespace NHibernate.Envers.Tests.Integration.AuditReader
+{
+ using System.Threading.Tasks;
+ public partial class AuditReaderAPITest : TestBase
+ {
+
+ [Test]
+ public async Task ShouldAuditAsync()
+ {
+ AuditReader().IsEntityClassAudited(typeof (AuditedTestEntity))
+ .Should().Be.True();
+ AuditReader().IsEntityNameAudited(typeof(AuditedTestEntity).FullName)
+ .Should().Be.True();
+ (await (AuditReader().GetRevisionsAsync(typeof(AuditedTestEntity),1)).ConfigureAwait(false))
+ .Should().Have.SameSequenceAs(1, 2);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/Basic/ColumnScalePrecisionTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/Basic/ColumnScalePrecisionTest.cs
new file mode 100644
index 00000000..459d93f8
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/Basic/ColumnScalePrecisionTest.cs
@@ -0,0 +1,36 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using NHibernate.Mapping;
+using NUnit.Framework;
+using SharpTestsEx;
+
+namespace NHibernate.Envers.Tests.Integration.Basic
+{
+ using System.Threading.Tasks;
+ public partial class ColumnScalePrecisionTest : TestBase
+ {
+
+ [Test]
+ public async Task VerifyRevisionCountsAsync()
+ {
+ (await (AuditReader().GetRevisionsAsync(typeof (ScalePrecisionEntity), id)).ConfigureAwait(false))
+ .Should().Have.SameSequenceAs(1);
+ }
+
+ [Test]
+ public async Task VerifyHistoryOfScalePrecisionEntityAsync()
+ {
+ var ver1 = new ScalePrecisionEntity {Id = id, Number = 13};
+ (await (AuditReader().FindAsync(id, 1)).ConfigureAwait(false))
+ .Should().Be.EqualTo(ver1);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/Basic/DeleteTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/Basic/DeleteTest.cs
new file mode 100644
index 00000000..2b6a72ac
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/Basic/DeleteTest.cs
@@ -0,0 +1,58 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using NUnit.Framework;
+
+namespace NHibernate.Envers.Tests.Integration.Basic
+{
+ using System.Threading.Tasks;
+ public partial class DeleteTest : TestBase
+ {
+
+ [Test]
+ public async Task VerifyRevisionCountAsync()
+ {
+ CollectionAssert.AreEquivalent(new[] {1, 2, 4}, await (AuditReader().GetRevisionsAsync(typeof(BasicTestEntity2),id1)).ConfigureAwait(false));
+ CollectionAssert.AreEquivalent(new[] {1, 3}, await (AuditReader().GetRevisionsAsync(typeof(BasicTestEntity2),id2)).ConfigureAwait(false));
+ CollectionAssert.AreEquivalent(new[] {1, 2}, await (AuditReader().GetRevisionsAsync(typeof(BasicTestEntity2),id3)).ConfigureAwait(false));
+ }
+
+ [Test]
+ public async Task VerifyHistoryOf1Async()
+ {
+ var ver1 = new BasicTestEntity2 {Id = id1, Str1 = "x"};
+ var ver2 = new BasicTestEntity2 {Id = id1, Str1 = "x2"};
+ Assert.AreEqual(ver1, await (AuditReader().FindAsync(id1, 1)).ConfigureAwait(false));
+ Assert.AreEqual(ver2, await (AuditReader().FindAsync(id1, 2)).ConfigureAwait(false));
+ Assert.AreEqual(ver2, await (AuditReader().FindAsync(id1, 3)).ConfigureAwait(false));
+ Assert.IsNull(await (AuditReader().FindAsync(id1, 4)).ConfigureAwait(false));
+ }
+
+ [Test]
+ public async Task VerifyHistoryOf2Async()
+ {
+ var ver1 = new BasicTestEntity2 { Id = id2, Str1 = "y" };
+ Assert.AreEqual(ver1, await (AuditReader().FindAsync(id2, 1)).ConfigureAwait(false));
+ Assert.AreEqual(ver1, await (AuditReader().FindAsync(id2, 2)).ConfigureAwait(false));
+ Assert.IsNull(await (AuditReader().FindAsync(id2, 3)).ConfigureAwait(false));
+ Assert.IsNull(await (AuditReader().FindAsync(id2, 4)).ConfigureAwait(false));
+ }
+
+ [Test]
+ public async Task VerifyHistoryOf3Async()
+ {
+ var ver1 = new BasicTestEntity2 { Id = id3, Str1 = "z" };
+ Assert.AreEqual(ver1, await (AuditReader().FindAsync(id3, 1)).ConfigureAwait(false));
+ Assert.IsNull(await (AuditReader().FindAsync(id3, 2)).ConfigureAwait(false));
+ Assert.IsNull(await (AuditReader().FindAsync(id3, 3)).ConfigureAwait(false));
+ Assert.IsNull(await (AuditReader().FindAsync(id3, 4)).ConfigureAwait(false));
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/Basic/EmptyStringTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/Basic/EmptyStringTest.cs
new file mode 100644
index 00000000..dc629243
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/Basic/EmptyStringTest.cs
@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using System.Collections.Generic;
+using NHibernate.Dialect;
+using NHibernate.Envers.Tests.Entities;
+using NUnit.Framework;
+using SharpTestsEx;
+
+namespace NHibernate.Envers.Tests.Integration.Basic
+{
+ using System.Threading.Tasks;
+ public partial class EmptyStringTest : TestBase
+ {
+
+ [Test]
+ public async Task VerifyRevisionCountsAsync()
+ {
+ (await (AuditReader().GetRevisionsAsync(typeof (StrTestEntity), emptyId)).ConfigureAwait(false)).Should().Have.SameSequenceAs(1);
+ (await (AuditReader().GetRevisionsAsync(typeof (StrTestEntity), nullId)).ConfigureAwait(false)).Should().Have.SameSequenceAs(1);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/Basic/GlobalVersionedTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/Basic/GlobalVersionedTest.cs
new file mode 100644
index 00000000..b91f5cc1
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/Basic/GlobalVersionedTest.cs
@@ -0,0 +1,35 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using NUnit.Framework;
+
+namespace NHibernate.Envers.Tests.Integration.Basic
+{
+ using System.Threading.Tasks;
+ public partial class GlobalVersionedTest : TestBase
+ {
+
+ [Test]
+ public async Task VerifyRevisionCountAsync()
+ {
+ CollectionAssert.AreEquivalent(new[] { 1, 2 }, await (AuditReader().GetRevisionsAsync(typeof(BasicTestEntity4), id1)).ConfigureAwait(false));
+ }
+
+ [Test]
+ public async Task VerifyHistoryAsync()
+ {
+ var ver1 = new BasicTestEntity4 { Id = id1, Str1 = "x", Str2 = "y" };
+ var ver2 = new BasicTestEntity4 { Id = id1, Str1 = "a", Str2 = "b" };
+
+ Assert.AreEqual(ver1, await (AuditReader().FindAsync(id1, 1)).ConfigureAwait(false));
+ Assert.AreEqual(ver2, await (AuditReader().FindAsync(id1, 2)).ConfigureAwait(false));
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/Basic/ManyOperationsInTransactionTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/Basic/ManyOperationsInTransactionTest.cs
new file mode 100644
index 00000000..5bb6d7d6
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/Basic/ManyOperationsInTransactionTest.cs
@@ -0,0 +1,61 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using NUnit.Framework;
+
+namespace NHibernate.Envers.Tests.Integration.Basic
+{
+ using System.Threading.Tasks;
+ public partial class ManyOperationsInTransactionTest : TestBase
+ {
+
+ [Test]
+ public async Task VerifyRevisionCountsAsync()
+ {
+ CollectionAssert.AreEquivalent(new[] { 1, 2 }, await (AuditReader().GetRevisionsAsync(typeof(BasicTestEntity1), id1)).ConfigureAwait(false));
+ CollectionAssert.AreEquivalent(new[] { 1, 2, 3 }, await (AuditReader().GetRevisionsAsync(typeof(BasicTestEntity1), id2)).ConfigureAwait(false));
+ CollectionAssert.AreEquivalent(new[] { 2, 3 }, await (AuditReader().GetRevisionsAsync(typeof(BasicTestEntity1), id3)).ConfigureAwait(false));
+ }
+
+ [Test]
+ public async Task VerifyHistoryOf1Async()
+ {
+ var ver1 = new BasicTestEntity1 { Id = id1, Str1 = "x", Long1 = 1 };
+ var ver2 = new BasicTestEntity1 { Id = id1, Str1 = "x2", Long1 = 1 };
+
+ Assert.AreEqual(ver1, await (AuditReader().FindAsync(id1, 1)).ConfigureAwait(false));
+ Assert.AreEqual(ver2, await (AuditReader().FindAsync(id1, 2)).ConfigureAwait(false));
+ Assert.AreEqual(ver2, await (AuditReader().FindAsync(id1, 3)).ConfigureAwait(false));
+ }
+
+ [Test]
+ public async Task VerifyHistoryOf2Async()
+ {
+ var ver1 = new BasicTestEntity1 { Id = id2, Str1 = "y", Long1 = 20 };
+ var ver2 = new BasicTestEntity1 { Id = id2, Str1 = "y", Long1 = 21 };
+ var ver3 = new BasicTestEntity1 { Id = id2, Str1 = "y3", Long1 = 22 };
+
+ Assert.AreEqual(ver1, await (AuditReader().FindAsync(id2, 1)).ConfigureAwait(false));
+ Assert.AreEqual(ver2, await (AuditReader().FindAsync(id2, 2)).ConfigureAwait(false));
+ Assert.AreEqual(ver3, await (AuditReader().FindAsync(id2, 3)).ConfigureAwait(false));
+ }
+
+ [Test]
+ public async Task VerifyHistoryOf3Async()
+ {
+ var ver1 = new BasicTestEntity1 { Id = id3, Str1 = "z", Long1 = 300 };
+ var ver2 = new BasicTestEntity1 { Id = id3, Str1 = "z3", Long1 = 300 };
+
+ Assert.IsNull(await (AuditReader().FindAsync(id3, 1)).ConfigureAwait(false));
+ Assert.AreEqual(ver1, await (AuditReader().FindAsync(id3, 2)).ConfigureAwait(false));
+ Assert.AreEqual(ver2, await (AuditReader().FindAsync(id3, 3)).ConfigureAwait(false));
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/Basic/NullPropertiesTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/Basic/NullPropertiesTest.cs
new file mode 100644
index 00000000..428f0c17
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/Basic/NullPropertiesTest.cs
@@ -0,0 +1,50 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using NUnit.Framework;
+
+namespace NHibernate.Envers.Tests.Integration.Basic
+{
+ using System.Threading.Tasks;
+ public partial class NullPropertiesTest : TestBase
+ {
+
+ [Test]
+ public async Task VerifyRevisionCountsAsync()
+ {
+ CollectionAssert.AreEquivalent(new[] { 1, 3 }, await (AuditReader().GetRevisionsAsync(typeof(BasicTestEntity1), id1)).ConfigureAwait(false));
+ CollectionAssert.AreEquivalent(new[] { 2, 4 }, await (AuditReader().GetRevisionsAsync(typeof(BasicTestEntity1), id2)).ConfigureAwait(false));
+ }
+
+ [Test]
+ public async Task VerifyHistoryOf1Async()
+ {
+ var ver1 = new BasicTestEntity1 { Id = id1, Str1 = "x", Long1 = 1 };
+ var ver2 = new BasicTestEntity1 { Id = id1, Long1 = 1 };
+
+ Assert.AreEqual(ver1, await (AuditReader().FindAsync(id1, 1)).ConfigureAwait(false));
+ Assert.AreEqual(ver1, await (AuditReader().FindAsync(id1, 2)).ConfigureAwait(false));
+ Assert.AreEqual(ver2, await (AuditReader().FindAsync(id1, 3)).ConfigureAwait(false));
+ Assert.AreEqual(ver2, await (AuditReader().FindAsync(id1, 4)).ConfigureAwait(false));
+ }
+
+ [Test]
+ public async Task VerifyHistoryOf2Async()
+ {
+ var ver1 = new BasicTestEntity1 { Id = id2, Long1 = 20 };
+ var ver2 = new BasicTestEntity1 { Id = id2, Str1 = "y2", Long1 = 20 };
+
+ Assert.IsNull(await (AuditReader().FindAsync(id2, 1)).ConfigureAwait(false));
+ Assert.AreEqual(ver1, await (AuditReader().FindAsync(id2, 2)).ConfigureAwait(false));
+ Assert.AreEqual(ver1, await (AuditReader().FindAsync(id2, 3)).ConfigureAwait(false));
+ Assert.AreEqual(ver2, await (AuditReader().FindAsync(id2, 4)).ConfigureAwait(false));
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/Basic/OutsideTransactionTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/Basic/OutsideTransactionTest.cs
new file mode 100644
index 00000000..af6d2ff1
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/Basic/OutsideTransactionTest.cs
@@ -0,0 +1,99 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using System.Collections.Generic;
+using System.Transactions;
+using NHibernate.Envers.Configuration;
+using NHibernate.Envers.Exceptions;
+using NHibernate.Envers.Tests.Entities;
+using NHibernate.Envers.Tests.Integration.Collection.NoRevision;
+using NUnit.Framework;
+
+namespace NHibernate.Envers.Tests.Integration.Basic
+{
+ using System.Threading.Tasks;
+ public partial class OutsideTransactionTest : TestBase
+ {
+
+ [Test]
+ public async Task ShouldThrowIfUpdateOutsideActiveTransactionAsync()
+ {
+ var entity = new StrTestEntity { Str = "data" };
+ using (var tx = Session.BeginTransaction())
+ {
+ await (Session.SaveAsync(entity)).ConfigureAwait(false);
+ await (tx.CommitAsync()).ConfigureAwait(false);
+ }
+ // Illegal modification of entity state outside of active transaction.
+ entity.Str = "modified data";
+ Assert.Throws(() => {
+ Session.Update(entity);
+ Session.Flush();
+ });
+ }
+
+ [Test]
+ public async Task ShouldThrowIfDeleteOutsideActiveTransactionAsync()
+ {
+ var entity = new StrTestEntity { Str = "data" };
+ using (var tx = Session.BeginTransaction())
+ {
+ await (Session.SaveAsync(entity)).ConfigureAwait(false);
+ await (tx.CommitAsync()).ConfigureAwait(false);
+ }
+ // Illegal modification of entity state outside of active transaction.
+ Assert.Throws(() =>
+ {
+ Session.Delete(entity);
+ Session.Flush();
+ });
+ }
+
+ [Test]
+ public async Task ShouldThrowIfCollectionUpdateOutsideActiveTransactionAsync()
+ {
+ var person = new Person();
+ var name = new Name {TheName = "Name"};
+ person.Names.Add(name);
+ using (var tx = Session.BeginTransaction())
+ {
+ await (Session.SaveAsync(person)).ConfigureAwait(false);
+ await (tx.CommitAsync()).ConfigureAwait(false);
+ }
+ // Illegal collection update outside of active transaction.
+ person.Names.Remove(name);
+ Assert.Throws(() =>
+ {
+ Session.Update(person);
+ Session.Flush();
+ });
+ }
+
+ [Test]
+ public async Task ShouldThrowIfCollectionRemovalOutsideActiveTransactionAsync()
+ {
+ var person = new Person();
+ var name = new Name {TheName = "Name"};
+ person.Names.Add(name);
+ using (var tx = Session.BeginTransaction())
+ {
+ await (Session.SaveAsync(person)).ConfigureAwait(false);
+ await (tx.CommitAsync()).ConfigureAwait(false);
+ }
+ // Illegal collection update outside of active transaction.
+ person.Names = null;
+ Assert.Throws(() =>
+ {
+ Session.Update(person);
+ Session.Flush();
+ });
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/Basic/SimpleTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/Basic/SimpleTest.cs
new file mode 100644
index 00000000..e2808beb
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/Basic/SimpleTest.cs
@@ -0,0 +1,37 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using System.Collections.Generic;
+using NHibernate.Envers.Tests.Entities;
+using NUnit.Framework;
+
+namespace NHibernate.Envers.Tests.Integration.Basic
+{
+ using System.Threading.Tasks;
+ public partial class SimpleTest : TestBase
+ {
+
+ [Test]
+ public async Task VerifyRevisionCountAsync()
+ {
+ CollectionAssert.AreEquivalent(new[] { 1, 2 }, await (AuditReader().GetRevisionsAsync(typeof(IntTestEntity), id1)).ConfigureAwait(false));
+ }
+
+ [Test]
+ public async Task VerifyHistoryAsync()
+ {
+ var ver1 = new IntTestEntity { Id = id1, Number = 10 };
+ var ver2 = new IntTestEntity { Id = id1, Number = 20 };
+
+ Assert.AreEqual(ver1, await (AuditReader().FindAsync(id1, 1)).ConfigureAwait(false));
+ Assert.AreEqual(ver2, await (AuditReader().FindAsync(typeof(IntTestEntity),id1, 2)).ConfigureAwait(false));
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/Basic/SingleOperationInTransactionTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/Basic/SingleOperationInTransactionTest.cs
new file mode 100644
index 00000000..2ed2e5d1
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/Basic/SingleOperationInTransactionTest.cs
@@ -0,0 +1,82 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using System;
+using NHibernate.Envers.Exceptions;
+using NUnit.Framework;
+
+namespace NHibernate.Envers.Tests.Integration.Basic
+{
+ using System.Threading.Tasks;
+ public partial class SingleOperationInTransactionTest : TestBase
+ {
+
+ [Test]
+ public async Task VerifyRevisionCountsAsync()
+ {
+ CollectionAssert.AreEquivalent(new[] { 1, 4, 6 }, await (AuditReader().GetRevisionsAsync(typeof(BasicTestEntity1), id1)).ConfigureAwait(false));
+ CollectionAssert.AreEquivalent(new[] { 2, 5, 7 }, await (AuditReader().GetRevisionsAsync(typeof(BasicTestEntity1), id2)).ConfigureAwait(false));
+ CollectionAssert.AreEquivalent(new[] { 3 }, await (AuditReader().GetRevisionsAsync(typeof(BasicTestEntity1), id3)).ConfigureAwait(false));
+ }
+
+ [Test]
+ public async Task VerifyHistoryOf1Async()
+ {
+ var ver1 = new BasicTestEntity1 { Id = id1, Str1 = "x", Long1 = 1 };
+ var ver2 = new BasicTestEntity1 { Id = id1, Str1 = "x2", Long1 = 2 };
+ var ver3 = new BasicTestEntity1 { Id = id1, Str1 = "x3", Long1 = 3 };
+
+ Assert.AreEqual(ver1, await (AuditReader().FindAsync(id1, 1)).ConfigureAwait(false));
+ Assert.AreEqual(ver1, await (AuditReader().FindAsync(id1, 2)).ConfigureAwait(false));
+ Assert.AreEqual(ver1, await (AuditReader().FindAsync(id1, 3)).ConfigureAwait(false));
+ Assert.AreEqual(ver2, await (AuditReader().FindAsync(id1, 4)).ConfigureAwait(false));
+ Assert.AreEqual(ver2, await (AuditReader().FindAsync(id1, 5)).ConfigureAwait(false));
+ Assert.AreEqual(ver3, await (AuditReader().FindAsync(id1, 6)).ConfigureAwait(false));
+ Assert.AreEqual(ver3, await (AuditReader().FindAsync(id1, 7)).ConfigureAwait(false));
+ }
+
+ [Test]
+ public async Task VerifyHistoryOf2Async()
+ {
+ var ver1 = new BasicTestEntity1 { Id = id2, Str1 = "y", Long1 = 20 };
+ var ver2 = new BasicTestEntity1 { Id = id2, Str1 = "y2", Long1 = 20 };
+ var ver3 = new BasicTestEntity1 { Id = id2, Str1 = "y3", Long1 = 21 };
+
+ Assert.IsNull(await (AuditReader().FindAsync(id2, 1)).ConfigureAwait(false));
+ Assert.AreEqual(ver1, await (AuditReader().FindAsync(id2, 2)).ConfigureAwait(false));
+ Assert.AreEqual(ver1, await (AuditReader().FindAsync(id2, 3)).ConfigureAwait(false));
+ Assert.AreEqual(ver1, await (AuditReader().FindAsync(id2, 4)).ConfigureAwait(false));
+ Assert.AreEqual(ver2, await (AuditReader().FindAsync(id2, 5)).ConfigureAwait(false));
+ Assert.AreEqual(ver2, await (AuditReader().FindAsync(id2, 6)).ConfigureAwait(false));
+ Assert.AreEqual(ver3, await (AuditReader().FindAsync(id2, 7)).ConfigureAwait(false));
+ }
+
+ [Test]
+ public async Task VerifyHistoryOf3Async()
+ {
+ var ver1 = new BasicTestEntity1 { Id = id3, Str1 = "z", Long1 = 30 };
+
+ Assert.IsNull(await (AuditReader().FindAsync(id3, 1)).ConfigureAwait(false));
+ Assert.IsNull(await (AuditReader().FindAsync(id3, 2)).ConfigureAwait(false));
+ Assert.AreEqual(ver1, await (AuditReader().FindAsync(id3, 3)).ConfigureAwait(false));
+ Assert.AreEqual(ver1, await (AuditReader().FindAsync(id3, 4)).ConfigureAwait(false));
+ Assert.AreEqual(ver1, await (AuditReader().FindAsync(id3, 5)).ConfigureAwait(false));
+ Assert.AreEqual(ver1, await (AuditReader().FindAsync(id3, 6)).ConfigureAwait(false));
+ Assert.AreEqual(ver1, await (AuditReader().FindAsync(id3, 7)).ConfigureAwait(false));
+ }
+
+ [Test]
+ public async Task VerifyHistoryOfNonExistingEntityAsync()
+ {
+ Assert.IsNull(await (AuditReader().FindAsync(id1 + id2 + id3, 1)).ConfigureAwait(false));
+ Assert.IsNull(await (AuditReader().FindAsync(id1 + id2 + id3, 7)).ConfigureAwait(false));
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/Basic/TransactionRollbackBehaviourTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/Basic/TransactionRollbackBehaviourTest.cs
new file mode 100644
index 00000000..4418c5c0
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/Basic/TransactionRollbackBehaviourTest.cs
@@ -0,0 +1,48 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using System.Collections.Generic;
+using System.Linq;
+using NHibernate.Envers.Tests.Entities;
+using NUnit.Framework;
+using SharpTestsEx;
+
+namespace NHibernate.Envers.Tests.Integration.Basic
+{
+ using System.Threading.Tasks;
+ public partial class TransactionRollbackBehaviourTest : TestBase
+ {
+
+ [Test]
+ public async Task CommittedEntityShouldHaveAuditRecordAsync()
+ {
+ (await (AuditReader().GetRevisionsAsync(typeof(IntTestEntity), committedId)).ConfigureAwait(false)).Count().Should().Be.EqualTo(1);
+ }
+
+ [Test]
+ public async Task RollbackedEntityShouldHaveAuditRecordIfPersistedAsync()
+ {
+ //NH might persist rollbacked entity
+ //https://nhibernate.jira.com/browse/NH-3304
+ var revisions = await (AuditReader().GetRevisionsAsync(typeof (IntTestEntity), rollbackId)).ConfigureAwait(false);
+ var entity = await (Session.GetAsync(rollbackId)).ConfigureAwait(false);
+ if (entity == null)
+ {
+ revisions.Should().Be.Empty();
+ }
+ else
+ {
+ //if code generated poid, the session is still dirty when second transaction starts
+ // eg oracle dialects ends up here in this test
+ revisions.Count().Should().Be.EqualTo(1);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/Basic/UnversionedPropertiesChangeTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/Basic/UnversionedPropertiesChangeTest.cs
new file mode 100644
index 00000000..1b2de40b
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/Basic/UnversionedPropertiesChangeTest.cs
@@ -0,0 +1,35 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using NUnit.Framework;
+
+namespace NHibernate.Envers.Tests.Integration.Basic
+{
+ using System.Threading.Tasks;
+ public partial class UnversionedPropertiesChangeTest : TestBase
+ {
+
+ [Test]
+ public async Task VerifyRevisionCountsAsync()
+ {
+ CollectionAssert.AreEquivalent(new[] { 1, 2 }, await (AuditReader().GetRevisionsAsync(typeof(BasicTestEntity2), id1)).ConfigureAwait(false));
+ }
+
+ [Test]
+ public async Task VerifyHistoryOf1Async()
+ {
+ var ver1 = new BasicTestEntity2 { Id = id1, Str1 = "x"};
+ var ver2 = new BasicTestEntity2 { Id = id1, Str1 = "y"};
+
+ Assert.AreEqual(ver1, await (AuditReader().FindAsync(id1, 1)).ConfigureAwait(false));
+ Assert.AreEqual(ver2, await (AuditReader().FindAsync(id1, 2)).ConfigureAwait(false));
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/Basic/UnversionedPropertyTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/Basic/UnversionedPropertyTest.cs
new file mode 100644
index 00000000..643719fd
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/Basic/UnversionedPropertyTest.cs
@@ -0,0 +1,37 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using System.Collections.Generic;
+using NHibernate.Envers.Tests.Entities;
+using NUnit.Framework;
+
+namespace NHibernate.Envers.Tests.Integration.Basic
+{
+ using System.Threading.Tasks;
+ public partial class UnversionedPropertyTest : TestBase
+ {
+
+ [Test]
+ public async Task VerifyRevisionCountsAsync()
+ {
+ CollectionAssert.AreEquivalent(new[] { 1, 2}, await (AuditReader().GetRevisionsAsync(typeof(UnversionedEntity), id1)).ConfigureAwait(false));
+ }
+
+ [Test]
+ public async Task VerifyHistoryOf1Async()
+ {
+ var ver1 = new UnversionedEntity { Id = id1, Str1 = "a1" };
+ var ver2 = new UnversionedEntity { Id = id1, Str1 = "a2" };
+
+ Assert.AreEqual(ver1, await (AuditReader().FindAsync(id1, 1)).ConfigureAwait(false));
+ Assert.AreEqual(ver2, await (AuditReader().FindAsync(id1, 2)).ConfigureAwait(false));
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/Cache/OneToManyCacheTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/Cache/OneToManyCacheTest.cs
new file mode 100644
index 00000000..8e440b37
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/Cache/OneToManyCacheTest.cs
@@ -0,0 +1,73 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using System.Collections.Generic;
+using NHibernate.Envers.Tests.Entities.OneToMany;
+using NUnit.Framework;
+
+namespace NHibernate.Envers.Tests.Integration.Cache
+{
+ using System.Threading.Tasks;
+ public partial class OneToManyCacheTest : TestBase
+ {
+
+ [Test]
+ public async Task VerifyCacheReferenceAfterFindAsync()
+ {
+ var ed1_rev1 = await (AuditReader().FindAsync(ed1_id, 1)).ConfigureAwait(false);
+ var ing1_rev1 = await (AuditReader().FindAsync(ing1_id, 1)).ConfigureAwait(false);
+ var ing2_rev1 = await (AuditReader().FindAsync(ing2_id, 1)).ConfigureAwait(false);
+
+ Assert.AreSame(ing1_rev1.Reference, ed1_rev1);
+ Assert.AreSame(ing2_rev1.Reference, ed1_rev1);
+
+ }
+
+ [Test]
+ public async Task VerifyCacheReferenceAccessAfterCollectionAccessRev1Async()
+ {
+ var ed1_rev1 = await (AuditReader().FindAsync(ed1_id, 1)).ConfigureAwait(false);
+ Assert.AreEqual(2, ed1_rev1.Reffering.Count);
+ foreach (var setRefIngEntity in ed1_rev1.Reffering)
+ {
+ Assert.AreSame(setRefIngEntity.Reference, ed1_rev1);
+ }
+ }
+
+ [Test]
+ public async Task VerifyCacheReferenceAccessAfterCollectionAccessRev2Async()
+ {
+ var ed1_rev2 = await (AuditReader().FindAsync(ed1_id, 1)).ConfigureAwait(false);
+ Assert.AreEqual(2, ed1_rev2.Reffering.Count);
+ foreach (var setRefIngEntity in ed1_rev2.Reffering)
+ {
+ Assert.AreSame(setRefIngEntity.Reference, ed1_rev2);
+ }
+ }
+
+ [Test]
+ public async Task VerifyCacheFindAfterCollectionAccessRev1Async()
+ {
+ var ed1_rev1 = await (AuditReader().FindAsync(ed1_id, 1)).ConfigureAwait(false);
+
+ // Reading the collection
+ Assert.AreEqual(2, ed1_rev1.Reffering.Count);
+
+ var ing1_rev1 = await (AuditReader().FindAsync(ing1_id, 1)).ConfigureAwait(false);
+ var ing2_rev1 = await (AuditReader().FindAsync(ing2_id, 1)).ConfigureAwait(false);
+ foreach (var setRefIngEntity in ed1_rev1.Reffering)
+ {
+ if (setRefIngEntity == ing1_rev1 || setRefIngEntity == ing2_rev1)
+ continue;
+ Assert.Fail();
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/Cache/OneToOneCacheTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/Cache/OneToOneCacheTest.cs
new file mode 100644
index 00000000..a7c33b08
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/Cache/OneToOneCacheTest.cs
@@ -0,0 +1,39 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using System.Collections.Generic;
+using NHibernate.Envers.Tests.Integration.OneToOne.BiDirectional;
+using NUnit.Framework;
+
+namespace NHibernate.Envers.Tests.Integration.Cache
+{
+ using System.Threading.Tasks;
+ public partial class OneToOneCacheTest : TestBase
+ {
+
+ [Test]
+ public async Task VerifyCacheReferenceAccessAfterFindRev1Async()
+ {
+ var ed1_rev1 = await (AuditReader().FindAsync(ed1_id, 1)).ConfigureAwait(false);
+ var ing1_rev1 = await (AuditReader().FindAsync(ing1_id, 1)).ConfigureAwait(false);
+
+ Assert.AreSame(ing1_rev1.Reference, ed1_rev1);
+ }
+
+ [Test]
+ public async Task VerifyCacheReferenceAccessAfterFindRev2Async()
+ {
+ var ed2_rev2 = await (AuditReader().FindAsync(ed2_id, 2)).ConfigureAwait(false);
+ var ing1_rev2 = await (AuditReader().FindAsync(ing1_id, 2)).ConfigureAwait(false);
+
+ Assert.AreSame(ing1_rev2.Reference, ed2_rev2);
+ }
+ }
+}
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/Cache/QueryCacheTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/Cache/QueryCacheTest.cs
new file mode 100644
index 00000000..2c213bd8
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/Cache/QueryCacheTest.cs
@@ -0,0 +1,45 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using System.Collections.Generic;
+using NHibernate.Envers.Tests.Entities;
+using NUnit.Framework;
+
+namespace NHibernate.Envers.Tests.Integration.Cache
+{
+ using System.Threading.Tasks;
+ public partial class QueryCacheTest : TestBase
+ {
+
+ [Test]
+ public async Task VerifyCacheFindAfterRevisionOfEntityQueryAsync()
+ {
+ var entsFromQuery = await (AuditReader().CreateQuery()
+ .ForRevisionsOfEntity(typeof (IntTestEntity), true, false)
+ .GetResultListAsync()).ConfigureAwait(false);
+
+ var entFromFindRev1 = await (AuditReader().FindAsync(id1, 1)).ConfigureAwait(false);
+ var entFromFindRev2 = await (AuditReader().FindAsync(id1, 2)).ConfigureAwait(false);
+
+ Assert.AreSame(entFromFindRev1, entsFromQuery[0]);
+ Assert.AreSame(entFromFindRev2, entsFromQuery[1]);
+ }
+
+ [Test]
+ public async Task VerifyCacheFindAfterEntitiesAtRevisionQueryAsync()
+ {
+ var entFromQuery = (IntTestEntity) await (AuditReader().CreateQuery()
+ .ForEntitiesAtRevision(typeof (IntTestEntity), 1)
+ .GetSingleResultAsync()).ConfigureAwait(false);
+ var entFromFind = await (AuditReader().FindAsync(id1, 1)).ConfigureAwait(false);
+ Assert.AreSame(entFromFind, entFromQuery);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/Collection/Embeddable/BasicEmbeddableCollectionTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/Collection/Embeddable/BasicEmbeddableCollectionTest.cs
new file mode 100644
index 00000000..7aff257c
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/Collection/Embeddable/BasicEmbeddableCollectionTest.cs
@@ -0,0 +1,56 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using NUnit.Framework;
+using SharpTestsEx;
+
+namespace NHibernate.Envers.Tests.Integration.Collection.Embeddable
+{
+ using System.Threading.Tasks;
+ public partial class BasicEmbeddableCollectionTest : TestBase
+ {
+
+ [Test]
+ public async Task VerifyRevisionCountsAsync()
+ {
+ (await (AuditReader().GetRevisionsAsync(typeof (DarkCharacter), id)).ConfigureAwait(false))
+ .Should().Have.SameSequenceAs(1, 2, 3, 4, 5);
+ }
+
+ [Test]
+ public async Task VerifyHistoryOfCharacterAsync()
+ {
+ var darkCharacter = new DarkCharacter {Id = id, Kills = 1};
+ var ver1 = await (AuditReader().FindAsync(id, 1)).ConfigureAwait(false);
+ ver1.Should().Be.EqualTo(darkCharacter);
+ ver1.Names.Should().Be.Empty();
+
+ darkCharacter.Names.Add(new Name { FirstName = "Action", LastName = "Hank" });
+ var ver2 = await (AuditReader().FindAsync(id, 2)).ConfigureAwait(false);
+ ver2.Should().Be.EqualTo(darkCharacter);
+ ver2.Names.Should().Have.SameValuesAs(darkCharacter.Names);
+
+ darkCharacter.Names.Add(new Name { FirstName = "Green", LastName = "Lantern" });
+ var ver3 = await (AuditReader().FindAsync(id, 3)).ConfigureAwait(false);
+ ver3.Should().Be.EqualTo(darkCharacter);
+ ver3.Names.Should().Have.SameValuesAs(darkCharacter.Names);
+
+ darkCharacter.Names.Remove(new Name { FirstName = "Action", LastName = "Hank" });
+ var ver4 = await (AuditReader().FindAsync(id, 4)).ConfigureAwait(false);
+ ver4.Should().Be.EqualTo(darkCharacter);
+ ver4.Names.Should().Have.SameValuesAs(darkCharacter.Names);
+
+ darkCharacter.Names.Clear();
+ var ver5 = await (AuditReader().FindAsync(id, 5)).ConfigureAwait(false);
+ ver5.Should().Be.EqualTo(darkCharacter);
+ ver5.Names.Should().Have.SameValuesAs(darkCharacter.Names);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/Collection/Embeddable/EmbeddableList1Test.cs b/Src/NHibernate.Envers.Tests/Async/Integration/Collection/Embeddable/EmbeddableList1Test.cs
new file mode 100644
index 00000000..52ce57f3
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/Collection/Embeddable/EmbeddableList1Test.cs
@@ -0,0 +1,44 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using System.Collections.Generic;
+using NHibernate.Envers.Tests.Entities.Collection;
+using NHibernate.Envers.Tests.Entities.Components;
+using NUnit.Framework;
+using SharpTestsEx;
+
+namespace NHibernate.Envers.Tests.Integration.Collection.Embeddable
+{
+ using System.Threading.Tasks;
+ public partial class EmbeddableList1Test : TestBase
+ {
+
+ [Test]
+ public async Task VerifyRevisionCountsAsync()
+ {
+ (await (AuditReader().GetRevisionsAsync(typeof (EmbeddableListEntity1), ele1Id)).ConfigureAwait(false))
+ .Should().Have.SameSequenceAs(1, 2, 3, 4);
+ }
+
+ [Test]
+ public async Task VerifyHistoryOfEle1Async()
+ {
+ var rev1 = await (AuditReader().FindAsync(ele1Id, 1)).ConfigureAwait(false);
+ var rev2 = await (AuditReader().FindAsync(ele1Id, 2)).ConfigureAwait(false);
+ var rev3 = await (AuditReader().FindAsync(ele1Id, 3)).ConfigureAwait(false);
+ var rev4 = await (AuditReader().FindAsync(ele1Id, 4)).ConfigureAwait(false);
+
+ rev1.ComponentList.Should().Have.SameSequenceAs(c3_1);
+ rev2.ComponentList.Should().Have.SameSequenceAs(c3_1, c3_2);
+ rev3.ComponentList.Should().Have.SameSequenceAs(c3_1, c3_2, c3_1);
+ rev4.ComponentList.Should().Have.SameSequenceAs(c3_1, c3_1);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/Collection/Embeddable/EmbeddableList2Test.cs b/Src/NHibernate.Envers.Tests/Async/Integration/Collection/Embeddable/EmbeddableList2Test.cs
new file mode 100644
index 00000000..9e458c10
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/Collection/Embeddable/EmbeddableList2Test.cs
@@ -0,0 +1,85 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using System.Collections.Generic;
+using NHibernate.Envers.Tests.Entities.Collection;
+using NHibernate.Envers.Tests.Entities.Components.Relations;
+using NUnit.Framework;
+using SharpTestsEx;
+
+namespace NHibernate.Envers.Tests.Integration.Collection.Embeddable
+{
+ using System.Threading.Tasks;
+ public partial class EmbeddableList2Test : TestBase
+ {
+
+ [Test]
+ public async Task VerifyRevisionCountsAsync()
+ {
+ (await (AuditReader().GetRevisionsAsync(typeof (EmbeddableListEntity2), eleId1)).ConfigureAwait(false)).Should().Have.SameSequenceAs(1, 2, 3, 4, 5, 7, 8);
+ (await (AuditReader().GetRevisionsAsync(typeof (StrTestNoProxyEntity), entity1.Id)).ConfigureAwait(false)).Should().Have.SameSequenceAs(1);
+ (await (AuditReader().GetRevisionsAsync(typeof (StrTestNoProxyEntity), entity2.Id)).ConfigureAwait(false)).Should().Have.SameSequenceAs(1);
+ (await (AuditReader().GetRevisionsAsync(typeof (StrTestNoProxyEntity), entity3.Id)).ConfigureAwait(false)).Should().Have.SameSequenceAs(4);
+ (await (AuditReader().GetRevisionsAsync(typeof (StrTestNoProxyEntity), entity4.Id)).ConfigureAwait(false)).Should().Have.SameSequenceAs(5, 6);
+ }
+
+ [Test]
+ public async Task VerifyManyToOneComponentListAsync()
+ {
+ // Revision 1: many-to-one component1 in the list
+ var rev1 = await (AuditReader().FindAsync(eleId1, 1)).ConfigureAwait(false);
+ rev1.Should().Not.Be.Null();
+ rev1.ComponentList.Should().Not.Be.Empty();
+ rev1.ComponentList[0].Data.Should().Be.EqualTo("dataComponent1");
+ rev1.ComponentList[0].Entity.Should().Be.EqualTo(entity1);
+ }
+
+ [Test]
+ public async Task VerifyHistoryOfEle1Async()
+ {
+ // Revision 1: many-to-one component in the list
+ (await (AuditReader().FindAsync(eleId1, 1)).ConfigureAwait(false)).ComponentList
+ .Should().Have.SameSequenceAs(new ManyToOneEagerComponent {Data = "dataComponent1", Entity = entity1});
+
+ // Revision 2: many-to-one component in the list
+ (await (AuditReader().FindAsync(eleId1, 2)).ConfigureAwait(false)).ComponentList
+ .Should().Have.SameSequenceAs(new ManyToOneEagerComponent { Data = "dataComponent2", Entity = entity2 });
+
+ // Revision 3: two many-to-one components in the list
+ (await (AuditReader().FindAsync(eleId1, 3)).ConfigureAwait(false)).ComponentList
+ .Should().Have.SameSequenceAs(new ManyToOneEagerComponent { Data = "dataComponent2", Entity = entity2 },
+ new ManyToOneEagerComponent{Data="dataComponent1", Entity = entity1});
+
+ // Revision 4: second component edited and first one in the list
+ (await (AuditReader().FindAsync(eleId1, 4)).ConfigureAwait(false)).ComponentList
+ .Should().Have.SameSequenceAs(new ManyToOneEagerComponent { Data = "dataComponent3", Entity = entity3 },
+ new ManyToOneEagerComponent { Data = "dataComponent1", Entity = entity1 });
+
+ // Revision 5: fourth component added in the list
+ (await (AuditReader().FindAsync(eleId1, 5)).ConfigureAwait(false)).ComponentList
+ .Should().Have.SameSequenceAs(new ManyToOneEagerComponent { Data = "dataComponent3", Entity = entity3 },
+ new ManyToOneEagerComponent { Data = "dataComponent1", Entity = entity1 },
+ new ManyToOneEagerComponent { Data = "dataComponent4", Entity = entity4Copy });
+
+ // Revision 6: changing fourth component property
+ (await (AuditReader().FindAsync(eleId1, 6)).ConfigureAwait(false)).ComponentList
+ .Should().Have.SameSequenceAs(new ManyToOneEagerComponent { Data = "dataComponent3", Entity = entity3 },
+ new ManyToOneEagerComponent { Data = "dataComponent1", Entity = entity1 },
+ new ManyToOneEagerComponent { Data = "dataComponent4", Entity = entity4 });
+
+ // Revision 7: removing component number four
+ (await (AuditReader().FindAsync(eleId1, 7)).ConfigureAwait(false)).ComponentList
+ .Should().Have.SameSequenceAs(new ManyToOneEagerComponent { Data = "dataComponent3", Entity = entity3 },
+ new ManyToOneEagerComponent { Data = "dataComponent1", Entity = entity1 });
+
+ (await (AuditReader().FindAsync(eleId1, 8)).ConfigureAwait(false)).Should().Be.Null();
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/Collection/Embeddable/EmbeddableMapTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/Collection/Embeddable/EmbeddableMapTest.cs
new file mode 100644
index 00000000..1f7cb342
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/Collection/Embeddable/EmbeddableMapTest.cs
@@ -0,0 +1,61 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using System.Collections.Generic;
+using NHibernate.Envers.Tests.Entities.Collection;
+using NHibernate.Envers.Tests.Entities.Components;
+using NUnit.Framework;
+using SharpTestsEx;
+
+namespace NHibernate.Envers.Tests.Integration.Collection.Embeddable
+{
+ using System.Threading.Tasks;
+ public partial class EmbeddableMapTest : TestBase
+ {
+
+ [Test]
+ public async Task VerifyRevisionCountsAsync()
+ {
+ (await (AuditReader().GetRevisionsAsync(typeof(EmbeddableMapEntity), eme1Id)).ConfigureAwait(false))
+ .Should().Have.SameSequenceAs(1, 2, 3);
+ (await (AuditReader().GetRevisionsAsync(typeof(EmbeddableMapEntity), eme2Id)).ConfigureAwait(false))
+ .Should().Have.SameSequenceAs(1, 3);
+ }
+
+ [Test]
+ public async Task VerifyHistoryOfEme1Async()
+ {
+ var rev1 = await (AuditReader().FindAsync(eme1Id, 1)).ConfigureAwait(false);
+ var rev2 = await (AuditReader().FindAsync(eme1Id, 2)).ConfigureAwait(false);
+ var rev3 = await (AuditReader().FindAsync(eme1Id, 3)).ConfigureAwait(false);
+ var rev4 = await (AuditReader().FindAsync(eme1Id, 4)).ConfigureAwait(false);
+
+ rev1.ComponentMap.Should().Be.Empty();
+ rev2.ComponentMap.Should().Have.SameValuesAs(new KeyValuePair("1", c3_1), new KeyValuePair("2", c3_2));
+ rev3.ComponentMap.Should().Have.SameValuesAs(new KeyValuePair("2", c3_2));
+ rev4.ComponentMap.Should().Have.SameValuesAs(new KeyValuePair("2", c3_2));
+ }
+
+ [Test]
+ public async Task VerifyHistoryOfEme2Async()
+ {
+ var rev1 = await (AuditReader().FindAsync(eme2Id, 1)).ConfigureAwait(false);
+ var rev2 = await (AuditReader().FindAsync(eme2Id, 2)).ConfigureAwait(false);
+ var rev3 = await (AuditReader().FindAsync(eme2Id, 3)).ConfigureAwait(false);
+ var rev4 = await (AuditReader().FindAsync(eme2Id, 4)).ConfigureAwait(false);
+
+
+ rev1.ComponentMap.Should().Have.SameValuesAs(new KeyValuePair("1", c3_1));
+ rev2.ComponentMap.Should().Have.SameValuesAs(new KeyValuePair("1", c3_1));
+ rev3.ComponentMap.Should().Have.SameValuesAs(new KeyValuePair("1", c3_2));
+ rev4.ComponentMap.Should().Have.SameValuesAs(new KeyValuePair("1", c3_2));
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/Collection/Embeddable/EmbeddableSetTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/Collection/Embeddable/EmbeddableSetTest.cs
new file mode 100644
index 00000000..a8d9f396
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/Collection/Embeddable/EmbeddableSetTest.cs
@@ -0,0 +1,50 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using System.Collections.Generic;
+using NHibernate.Envers.Tests.Entities.Collection;
+using NHibernate.Envers.Tests.Entities.Components;
+using NUnit.Framework;
+using SharpTestsEx;
+
+namespace NHibernate.Envers.Tests.Integration.Collection.Embeddable
+{
+ using System.Threading.Tasks;
+ public partial class EmbeddableSetTest : TestBase
+ {
+
+ [Test]
+ public async Task VerifyRevisionCountsAsync()
+ {
+ (await (AuditReader().GetRevisionsAsync(typeof (EmbeddableSetEntity), ese1Id)).ConfigureAwait(false))
+ .Should().Have.SameSequenceAs(1, 2, 3, 4, 5, 6, 7);
+ }
+
+ [Test]
+ public async Task VerifyHistoryOfEse1Async()
+ {
+ var rev1 = await (AuditReader().FindAsync(ese1Id, 1)).ConfigureAwait(false);
+ var rev2 = await (AuditReader().FindAsync(ese1Id, 2)).ConfigureAwait(false);
+ var rev3 = await (AuditReader().FindAsync(ese1Id, 3)).ConfigureAwait(false);
+ var rev4 = await (AuditReader().FindAsync(ese1Id, 4)).ConfigureAwait(false);
+ var rev5 = await (AuditReader().FindAsync(ese1Id, 5)).ConfigureAwait(false);
+ var rev6 = await (AuditReader().FindAsync(ese1Id, 6)).ConfigureAwait(false);
+ var rev7 = await (AuditReader().FindAsync(ese1Id, 7)).ConfigureAwait(false);
+
+ rev1.ComponentSet.Should().Have.SameValuesAs(c3_1, c3_3);
+ rev2.ComponentSet.Should().Have.SameValuesAs(c3_1, c3_2, c3_3);
+ rev3.ComponentSet.Should().Have.SameValuesAs(c3_1, c3_3);
+ rev4.ComponentSet.Should().Have.SameValuesAs(c3_1, c3_2, c3_3, c3_4);
+ rev5.ComponentSet.Should().Have.SameValuesAs(c3_1, c3_3);
+ rev6.ComponentSet.Should().Have.SameValuesAs(c3_2, c3_4);
+ rev7.ComponentSet.Should().Have.SameValuesAs(c3_2, c3_4, c3_1);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/Collection/EnumSetTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/Collection/EnumSetTest.cs
new file mode 100644
index 00000000..9f0675d7
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/Collection/EnumSetTest.cs
@@ -0,0 +1,43 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using System.Collections.Generic;
+using NHibernate.Envers.Tests.Entities.Collection;
+using NUnit.Framework;
+
+namespace NHibernate.Envers.Tests.Integration.Collection
+{
+ using System.Threading.Tasks;
+ public partial class EnumSetTest : TestBase
+ {
+
+ [Test]
+ public async Task VerifyRevisionCountAsync()
+ {
+ CollectionAssert.AreEquivalent(new[] { 1, 2, 3 }, await (AuditReader().GetRevisionsAsync(typeof(EnumSetEntity), sse1_id)).ConfigureAwait(false));
+ }
+
+ [Test]
+ public async Task VerifyHistoryOfAsync()
+ {
+ var rev1 = await (AuditReader().FindAsync(sse1_id, 1)).ConfigureAwait(false);
+ var rev2 = await (AuditReader().FindAsync(sse1_id, 2)).ConfigureAwait(false);
+ var rev3 = await (AuditReader().FindAsync(sse1_id, 3)).ConfigureAwait(false);
+
+ CollectionAssert.AreEquivalent(new[] { E1.X }, rev1.Enums1);
+ CollectionAssert.AreEquivalent(new[] { E1.X, E1.Y }, rev2.Enums1);
+ CollectionAssert.AreEquivalent(new[] { E1.Y }, rev3.Enums1);
+
+ CollectionAssert.AreEquivalent(new[] { E2.A }, rev1.Enums2);
+ CollectionAssert.AreEquivalent(new[] { E2.A }, rev2.Enums2);
+ CollectionAssert.AreEquivalent(new[] { E2.A }, rev3.Enums2);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/Collection/MapKey/ComponentMapKeyTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/Collection/MapKey/ComponentMapKeyTest.cs
new file mode 100644
index 00000000..2e7dfcbd
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/Collection/MapKey/ComponentMapKeyTest.cs
@@ -0,0 +1,44 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using System.Collections.Generic;
+using NHibernate.Envers.Tests.Entities.Components;
+using NUnit.Framework;
+
+namespace NHibernate.Envers.Tests.Integration.Collection.MapKey
+{
+ using System.Threading.Tasks;
+ public partial class ComponentMapKeyTest : TestBase
+ {
+
+ [Test]
+ public async Task VerifyRevisionCountsAsync()
+ {
+ CollectionAssert.AreEquivalent(new[] { 1, 2 }, await (AuditReader().GetRevisionsAsync(typeof(ComponentMapKeyEntity), cmke_id)).ConfigureAwait(false));
+ }
+
+ [Test]
+ public async Task VerifyHistoryOfImkeAsync()
+ {
+ var cte1 = await (Session.GetAsync(cte1_id)).ConfigureAwait(false);
+ var cte2 = await (Session.GetAsync(cte2_id)).ConfigureAwait(false);
+
+ // These fields are unversioned.
+ cte1.Comp2 = null;
+ cte2.Comp2 = null;
+
+ var rev1 = await (AuditReader().FindAsync(cmke_id, 1)).ConfigureAwait(false);
+ var rev2 = await (AuditReader().FindAsync(cmke_id, 2)).ConfigureAwait(false);
+
+ Assert.AreEqual(new Dictionary { { cte1.Comp1, cte1 } }, rev1.IdMap);
+ Assert.AreEqual(new Dictionary { { cte1.Comp1, cte1 }, { cte2.Comp1, cte2 } }, rev2.IdMap);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/Collection/MapKey/IdMapKeyTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/Collection/MapKey/IdMapKeyTest.cs
new file mode 100644
index 00000000..317c2f7f
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/Collection/MapKey/IdMapKeyTest.cs
@@ -0,0 +1,40 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using System.Collections.Generic;
+using NHibernate.Envers.Tests.Entities;
+using NUnit.Framework;
+
+namespace NHibernate.Envers.Tests.Integration.Collection.MapKey
+{
+ using System.Threading.Tasks;
+ public partial class IdMapKeyTest : TestBase
+ {
+
+ [Test]
+ public async Task VerifyRevisionCountsAsync()
+ {
+ CollectionAssert.AreEquivalent(new[] { 1, 2 }, await (AuditReader().GetRevisionsAsync(typeof(IdMapKeyEntity), imke_id)).ConfigureAwait(false));
+ }
+
+ [Test]
+ public async Task VerifyHistoryOfImkeAsync()
+ {
+ var ste1 = await (Session.GetAsync(ste1_id)).ConfigureAwait(false);
+ var ste2 = await (Session.GetAsync(ste2_id)).ConfigureAwait(false);
+
+ var rev1 = await (AuditReader().FindAsync(imke_id, 1)).ConfigureAwait(false);
+ var rev2 = await (AuditReader().FindAsync(imke_id, 2)).ConfigureAwait(false);
+
+ Assert.AreEqual(new Dictionary { { ste1.Id, ste1 } }, rev1.IdMap);
+ Assert.AreEqual(new Dictionary { { ste1.Id, ste1 }, { ste2.Id, ste2 } }, rev2.IdMap);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/Collection/NoRevision/AbstractCollectionChangeTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/Collection/NoRevision/AbstractCollectionChangeTest.cs
new file mode 100644
index 00000000..9eac9ca8
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/Collection/NoRevision/AbstractCollectionChangeTest.cs
@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using System.Collections.Generic;
+using NHibernate.Cfg;
+using NHibernate.Envers.Configuration;
+using NUnit.Framework;
+using SharpTestsEx;
+
+namespace NHibernate.Envers.Tests.Integration.Collection.NoRevision
+{
+ using System.Threading.Tasks;
+ public abstract partial class AbstractCollectionChangeTest : TestBase
+ {
+
+ [Test]
+ public async Task VerifyPersonRevisionCountAsync()
+ {
+ (await (AuditReader().GetRevisionsAsync(typeof(Person),PersonId)).ConfigureAwait(false))
+ .Should().Have.SameSequenceAs(ExpectedPersonRevisions);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/Collection/StringListTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/Collection/StringListTest.cs
new file mode 100644
index 00000000..99a44316
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/Collection/StringListTest.cs
@@ -0,0 +1,53 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using System.Collections.Generic;
+using NHibernate.Envers.Tests.Entities.Collection;
+using NUnit.Framework;
+
+namespace NHibernate.Envers.Tests.Integration.Collection
+{
+ using System.Threading.Tasks;
+ public partial class StringListTest : TestBase
+ {
+
+
+ [Test]
+ public async Task VerifyRevisionCountAsync()
+ {
+ CollectionAssert.AreEquivalent(new[] { 1, 2, 3 }, await (AuditReader().GetRevisionsAsync(typeof(StringListEntity), sle1_id)).ConfigureAwait(false));
+ CollectionAssert.AreEquivalent(new[] { 1, 2, 3 }, await (AuditReader().GetRevisionsAsync(typeof(StringListEntity), sle2_id)).ConfigureAwait(false));
+ }
+
+ [Test]
+ public async Task VerifyHistoryOf1Async()
+ {
+ var rev1 = await (AuditReader().FindAsync(sle1_id, 1)).ConfigureAwait(false);
+ var rev2 = await (AuditReader().FindAsync(sle1_id, 2)).ConfigureAwait(false);
+ var rev3 = await (AuditReader().FindAsync(sle1_id, 3)).ConfigureAwait(false);
+
+ CollectionAssert.IsEmpty(rev1.Strings);
+ CollectionAssert.AreEqual(new[] { "sle1_string1", "sle1_string2" }, rev2.Strings);
+ CollectionAssert.AreEqual(new[] { "sle1_string3", "sle1_string2" }, rev3.Strings);
+ }
+
+ [Test]
+ public async Task VerifyHistoryOf2Async()
+ {
+ var rev1 = await (AuditReader().FindAsync(sle2_id, 1)).ConfigureAwait(false);
+ var rev2 = await (AuditReader().FindAsync(sle2_id, 2)).ConfigureAwait(false);
+ var rev3 = await (AuditReader().FindAsync(sle2_id, 3)).ConfigureAwait(false);
+
+ CollectionAssert.AreEqual(new[] { "sle2_string1", "sle2_string2" }, rev1.Strings);
+ CollectionAssert.AreEqual(new[] { "sle2_string1", "sle2_string2", "sle2_string1" }, rev2.Strings);
+ CollectionAssert.AreEqual(new[] { "sle2_string2", "sle2_string1" }, rev3.Strings);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/Collection/StringMapTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/Collection/StringMapTest.cs
new file mode 100644
index 00000000..58e3e3ac
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/Collection/StringMapTest.cs
@@ -0,0 +1,57 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using System.Collections.Generic;
+using System.Linq;
+using NHibernate.Envers.Tests.Entities.Collection;
+using NUnit.Framework;
+
+namespace NHibernate.Envers.Tests.Integration.Collection
+{
+ using System.Threading.Tasks;
+ public partial class StringMapTest : TestBase
+ {
+
+ [Test]
+ public async Task VerifyRevisionCountAsync()
+ {
+ CollectionAssert.AreEquivalent(new[] { 1, 2, 3 }, await (AuditReader().GetRevisionsAsync(typeof(StringMapEntity), sme1_id)).ConfigureAwait(false));
+ CollectionAssert.AreEquivalent(new[] { 1, 3 }, await (AuditReader().GetRevisionsAsync(typeof(StringMapEntity), sme2_id)).ConfigureAwait(false));
+ }
+
+ [Test]
+ public async Task VerifyHistoryOf1Async()
+ {
+ var rev1 = await (AuditReader().FindAsync(sme1_id, 1)).ConfigureAwait(false);
+ var rev2 = await (AuditReader().FindAsync(sme1_id, 2)).ConfigureAwait(false);
+ var rev3 = await (AuditReader().FindAsync(sme1_id, 3)).ConfigureAwait(false);
+ var rev4 = await (AuditReader().FindAsync(sme1_id, 4)).ConfigureAwait(false);
+
+ CollectionAssert.IsEmpty(rev1.Strings.Keys);
+ Assert.AreEqual(new Dictionary { { "1", "a" }, { "2", "b" } }, rev2.Strings.OrderBy(kv => kv.Key));
+ Assert.AreEqual(new Dictionary { { "2", "b" } }, rev3.Strings);
+ Assert.AreEqual(new Dictionary { { "2", "b" } }, rev4.Strings);
+ }
+
+ [Test]
+ public async Task VerifyHistoryOf2Async()
+ {
+ var rev1 = await (AuditReader().FindAsync(sme2_id, 1)).ConfigureAwait(false);
+ var rev2 = await (AuditReader().FindAsync(sme2_id, 2)).ConfigureAwait(false);
+ var rev3 = await (AuditReader().FindAsync(sme2_id, 3)).ConfigureAwait(false);
+ var rev4 = await (AuditReader().FindAsync(sme2_id, 4)).ConfigureAwait(false);
+
+ Assert.AreEqual(new Dictionary { { "1", "a" } }, rev1.Strings);
+ Assert.AreEqual(new Dictionary { { "1", "a" } }, rev2.Strings);
+ Assert.AreEqual(new Dictionary { { "1", "b" } }, rev3.Strings);
+ Assert.AreEqual(new Dictionary { { "1", "b" } }, rev4.Strings);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/Collection/StringSetTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/Collection/StringSetTest.cs
new file mode 100644
index 00000000..ca9e4fcb
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/Collection/StringSetTest.cs
@@ -0,0 +1,52 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using System.Collections.Generic;
+using NHibernate.Envers.Tests.Entities.Collection;
+using NUnit.Framework;
+
+namespace NHibernate.Envers.Tests.Integration.Collection
+{
+ using System.Threading.Tasks;
+ public partial class StringSetTest : TestBase
+ {
+
+ [Test]
+ public async Task VerifyRevisionCountAsync()
+ {
+ CollectionAssert.AreEquivalent(new[] { 1, 2 }, await (AuditReader().GetRevisionsAsync(typeof(StringSetEntity), sse1_id)).ConfigureAwait(false));
+ CollectionAssert.AreEquivalent(new[] { 1, 3 }, await (AuditReader().GetRevisionsAsync(typeof(StringSetEntity), sse2_id)).ConfigureAwait(false));
+ }
+
+ [Test]
+ public async Task VerifyHistoryOf1Async()
+ {
+ var rev1 = await (AuditReader().FindAsync(sse1_id, 1)).ConfigureAwait(false);
+ var rev2 = await (AuditReader().FindAsync(sse1_id, 2)).ConfigureAwait(false);
+ var rev3 = await (AuditReader().FindAsync(sse1_id, 3)).ConfigureAwait(false);
+
+ CollectionAssert.IsEmpty(rev1.Strings);
+ CollectionAssert.AreEquivalent(new[] { "sse1_string1", "sse1_string2" }, rev2.Strings);
+ CollectionAssert.AreEquivalent(new[] { "sse1_string1", "sse1_string2" }, rev3.Strings);
+ }
+
+ [Test]
+ public async Task VerifyHistoryOf2Async()
+ {
+ var rev1 = await (AuditReader().FindAsync(sse2_id, 1)).ConfigureAwait(false);
+ var rev2 = await (AuditReader().FindAsync(sse2_id, 2)).ConfigureAwait(false);
+ var rev3 = await (AuditReader().FindAsync(sse2_id, 3)).ConfigureAwait(false);
+
+ CollectionAssert.AreEquivalent(new[] { "sse2_string1", "sse2_string2" }, rev1.Strings);
+ CollectionAssert.AreEquivalent(new[] { "sse2_string1", "sse2_string2" }, rev2.Strings);
+ CollectionAssert.AreEquivalent(new[] { "sse2_string2" }, rev3.Strings);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/Components/Collections/CollectionOfComponentsTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/Components/Collections/CollectionOfComponentsTest.cs
new file mode 100644
index 00000000..a71d2d14
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/Components/Collections/CollectionOfComponentsTest.cs
@@ -0,0 +1,47 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using System.Collections.Generic;
+using NHibernate.Envers.Tests.Entities.Components;
+using NUnit.Framework;
+using SharpTestsEx;
+
+namespace NHibernate.Envers.Tests.Integration.Components.Collections
+{
+ using System.Threading.Tasks;
+ public partial class CollectionOfComponentsTest : TestBase
+ {
+
+ [Test]
+ public async Task VerifyRevisionCountsAsync()
+ {
+ CollectionAssert.AreEqual(new[] { 1, 2 }, await (AuditReader().GetRevisionsAsync(typeof(ComponentSetTestEntity), id1)).ConfigureAwait(false));
+ }
+
+ [Test]
+ public async Task VerifyHistoryOf1Async()
+ {
+ CollectionAssert.IsEmpty((await (AuditReader().FindAsync(id1, 1)).ConfigureAwait(false)).Comps);
+
+ var comps1 = (await (AuditReader().FindAsync(id1, 2)).ConfigureAwait(false)).Comps;
+ Assert.AreEqual(1, comps1.Count);
+ CollectionAssert.Contains(comps1, new Component1 { Str1 = "a", Str2 = "b" });
+ }
+
+ [Test]
+ public async Task VerifyCollectionOfEmbeddableWithNullValueAsync()
+ {
+ var componentV1 = new Component1 {Str1 = "string1", Str2 = null};
+ var entityV1 = await (AuditReader().FindAsync(id2, 1)).ConfigureAwait(false);
+
+ entityV1.Comps.Should().Have.SameSequenceAs(componentV1);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/Components/ComponentsTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/Components/ComponentsTest.cs
new file mode 100644
index 00000000..1d11f14b
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/Components/ComponentsTest.cs
@@ -0,0 +1,79 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using System.Collections.Generic;
+using NHibernate.Envers.Tests.Entities.Components;
+using NUnit.Framework;
+
+namespace NHibernate.Envers.Tests.Integration.Components
+{
+ using System.Threading.Tasks;
+ public partial class ComponentsTest : TestBase
+ {
+
+ [Test]
+ public async Task VerifyRevisionCountsAsync()
+ {
+ CollectionAssert.AreEqual(new[] { 1, 2 }, await (AuditReader().GetRevisionsAsync(typeof(ComponentTestEntity), id1)).ConfigureAwait(false));
+ CollectionAssert.AreEqual(new[] { 1, 2, 4 }, await (AuditReader().GetRevisionsAsync(typeof(ComponentTestEntity), id2)).ConfigureAwait(false));
+ CollectionAssert.AreEqual(new[] { 1, 3 }, await (AuditReader().GetRevisionsAsync(typeof(ComponentTestEntity), id3)).ConfigureAwait(false));
+ CollectionAssert.AreEqual(new[] { 1, 2, 3 }, await (AuditReader().GetRevisionsAsync(typeof(ComponentTestEntity), id4)).ConfigureAwait(false));
+ }
+
+ [Test]
+ public async Task VerifyHistoryOf1Async()
+ {
+ var ver1 = new ComponentTestEntity { Id = id1, Comp1 = new Component1 { Str1 = "a", Str2 = "b" } };
+ var ver2 = new ComponentTestEntity { Id = id1, Comp1 = new Component1 { Str1 = "a'", Str2 = "b'" } };
+
+ Assert.AreEqual(ver1, await (AuditReader().FindAsync(id1, 1)).ConfigureAwait(false));
+ Assert.AreEqual(ver2, await (AuditReader().FindAsync(id1, 2)).ConfigureAwait(false));
+ Assert.AreEqual(ver2, await (AuditReader().FindAsync(id1, 3)).ConfigureAwait(false));
+ Assert.AreEqual(ver2, await (AuditReader().FindAsync(id1, 4)).ConfigureAwait(false));
+ }
+
+ [Test]
+ public async Task VerifyHistoryOf2Async()
+ {
+ var ver1 = new ComponentTestEntity { Id = id2, Comp1 = new Component1 { Str1 = "a2", Str2 = "b2" } };
+ var ver2 = new ComponentTestEntity { Id = id2, Comp1 = new Component1 { Str1 = "a2'", Str2 = "b2" } };
+
+ Assert.AreEqual(ver1, await (AuditReader().FindAsync(id2, 1)).ConfigureAwait(false));
+ Assert.AreEqual(ver2, await (AuditReader().FindAsync(id2, 2)).ConfigureAwait(false));
+ Assert.AreEqual(ver2, await (AuditReader().FindAsync(id2, 3)).ConfigureAwait(false));
+ Assert.IsNull(await (AuditReader().FindAsync(id2, 4)).ConfigureAwait(false));
+ }
+
+ [Test]
+ public async Task VerifyHistoryOf3Async()
+ {
+ var ver1 = new ComponentTestEntity { Id = id3, Comp1 = new Component1 { Str1 = "a3", Str2 = "b3" } };
+ var ver2 = new ComponentTestEntity { Id = id3, Comp1 = new Component1 { Str1 = "a3", Str2 = "b3'" } };
+
+ Assert.AreEqual(ver1, await (AuditReader().FindAsync(id3, 1)).ConfigureAwait(false));
+ Assert.AreEqual(ver1, await (AuditReader().FindAsync(id3, 2)).ConfigureAwait(false));
+ Assert.AreEqual(ver2, await (AuditReader().FindAsync(id3, 3)).ConfigureAwait(false));
+ Assert.AreEqual(ver2, await (AuditReader().FindAsync(id3, 4)).ConfigureAwait(false));
+ }
+
+ [Test]
+ public async Task VerifyHistoryOf4Async()
+ {
+ var ver1 = new ComponentTestEntity { Id = id4 };
+ var ver2 = new ComponentTestEntity { Id = id4, Comp1 = new Component1 { Str1 = "n" } };
+ var ver3 = new ComponentTestEntity { Id = id4 };
+
+ Assert.AreEqual(ver1, await (AuditReader().FindAsync(id4, 1)).ConfigureAwait(false));
+ Assert.AreEqual(ver2, await (AuditReader().FindAsync(id4, 2)).ConfigureAwait(false));
+ Assert.AreEqual(ver3, await (AuditReader().FindAsync(id4, 3)).ConfigureAwait(false));
+ Assert.AreEqual(ver3, await (AuditReader().FindAsync(id4, 4)).ConfigureAwait(false));
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/Components/DefaultValueComponentsTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/Components/DefaultValueComponentsTest.cs
new file mode 100644
index 00000000..86e73fbb
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/Components/DefaultValueComponentsTest.cs
@@ -0,0 +1,111 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using System.Collections.Generic;
+using NHibernate.Envers.Tests.Entities.Components;
+using NUnit.Framework;
+using SharpTestsEx;
+
+namespace NHibernate.Envers.Tests.Integration.Components
+{
+ using System.Threading.Tasks;
+ public partial class DefaultValueComponentsTest : TestBase
+ {
+
+ [Test]
+ public async Task VerifyRevisionCountsAsync()
+ {
+ (await (AuditReader().GetRevisionsAsync(typeof (DefaultValueComponentTestEntity), id0)).ConfigureAwait(false)).Should().Have.SameSequenceAs(1, 2);
+ (await (AuditReader().GetRevisionsAsync(typeof (DefaultValueComponentTestEntity), id1)).ConfigureAwait(false)).Should().Have.SameSequenceAs(1, 2);
+ (await (AuditReader().GetRevisionsAsync(typeof (DefaultValueComponentTestEntity), id2)).ConfigureAwait(false)).Should().Have.SameSequenceAs(1, 2);
+ (await (AuditReader().GetRevisionsAsync(typeof (DefaultValueComponentTestEntity), id3)).ConfigureAwait(false)).Should().Have.SameSequenceAs(1, 2);
+ (await (AuditReader().GetRevisionsAsync(typeof (DefaultValueComponentTestEntity), id4)).ConfigureAwait(false)).Should().Have.SameSequenceAs(1, 2);
+ (await (AuditReader().GetRevisionsAsync(typeof (DefaultValueComponentTestEntity), id5)).ConfigureAwait(false)).Should().Have.SameSequenceAs(1, 2);
+ (await (AuditReader().GetRevisionsAsync(typeof (DefaultValueComponentTestEntity), id6)).ConfigureAwait(false)).Should().Have.SameSequenceAs(1, 2);
+ }
+
+ [Test]
+ public async Task VerifyHistoryOfId0Async()
+ {
+ var ent1 = await (AuditReader().FindAsync(id0, 1)).ConfigureAwait(false);
+ var ent2 = await (AuditReader().FindAsync(id0, 2)).ConfigureAwait(false);
+ var expectedVer1 = new DefaultValueComponentTestEntity {Id = id0, Comp1 = new DefaultValueComponent1{Str1 = null, Comp2 = null}};
+ var expectedVer2 = new DefaultValueComponentTestEntity { Id = id0, Comp1 = new DefaultValueComponent1 { Str1 = "upd-c1-str1", Comp2 = null } };
+ ent1.Should().Be.EqualTo(expectedVer1);
+ ent2.Should().Be.EqualTo(expectedVer2);
+ }
+
+ [Test]
+ public async Task VerifyHistoryOfId1Async()
+ {
+ var ent1 = await (AuditReader().FindAsync(id1, 1)).ConfigureAwait(false);
+ var ent2 = await (AuditReader().FindAsync(id1, 2)).ConfigureAwait(false);
+ var expectedVer1 = new DefaultValueComponentTestEntity { Id = id1, Comp1 = new DefaultValueComponent1 { Str1 = "c1-str1", Comp2 = null } };
+ var expectedVer2 = new DefaultValueComponentTestEntity { Id = id1, Comp1 = new DefaultValueComponent1 { Str1 = null, Comp2 = new DefaultValueComponent2 { Str1 = "upd-c2-str1", Str2 = "upd-c2-str2" } } };
+ ent1.Should().Be.EqualTo(expectedVer1);
+ ent2.Should().Be.EqualTo(expectedVer2);
+ }
+
+ [Test]
+ public async Task VerifyHistoryOfId2Async()
+ {
+ var ent1 = await (AuditReader().FindAsync(id2, 1)).ConfigureAwait(false);
+ var ent2 = await (AuditReader().FindAsync(id2, 2)).ConfigureAwait(false);
+ var expectedVer1 = new DefaultValueComponentTestEntity { Id = id2, Comp1 = new DefaultValueComponent1 { Str1 = "c1-str1", Comp2 = new DefaultValueComponent2 { Str1 = "c2-str1", Str2 = "c2-str2" } } };
+ var expectedVer2 = new DefaultValueComponentTestEntity { Id = id2, Comp1 = new DefaultValueComponent1 { Str1 = "c1-str1", Comp2 = new DefaultValueComponent2 { Str1 = "upd-c2-str1", Str2 = "c2-str2" } } };
+ ent1.Should().Be.EqualTo(expectedVer1);
+ ent2.Should().Be.EqualTo(expectedVer2);
+ }
+
+ [Test]
+ public async Task VerifyHistoryOfId3Async()
+ {
+ var ent1 = await (AuditReader().FindAsync(id3, 1)).ConfigureAwait(false);
+ var ent2 = await (AuditReader().FindAsync(id3, 2)).ConfigureAwait(false);
+ var expectedVer1 = new DefaultValueComponentTestEntity { Id = id3, Comp1 = new DefaultValueComponent1 { Str1 = null, Comp2 = new DefaultValueComponent2 { Str1 = "c2-str1", Str2 = "c2-str2" } } };
+ var expectedVer2 = new DefaultValueComponentTestEntity { Id = id3, Comp1 = new DefaultValueComponent1 { Str1 = null, Comp2 = new DefaultValueComponent2 { Str1 = "upd-c2-str1", Str2 = "c2-str2" } } };
+ ent1.Should().Be.EqualTo(expectedVer1);
+ ent2.Should().Be.EqualTo(expectedVer2);
+ }
+
+ [Test]
+ public async Task VerifyHistoryOfId4Async()
+ {
+ var ent1 = await (AuditReader().FindAsync(id4, 1)).ConfigureAwait(false);
+ var ent2 = await (AuditReader().FindAsync(id4, 2)).ConfigureAwait(false);
+ var expectedVer1 = new DefaultValueComponentTestEntity { Id = id4, Comp1 = new DefaultValueComponent1 { Str1 = null, Comp2 = new DefaultValueComponent2 { Str1 = null, Str2 = "c2-str2" } } };
+ var expectedVer2 = new DefaultValueComponentTestEntity { Id = id4, Comp1 = new DefaultValueComponent1 { Str1 = null, Comp2 = new DefaultValueComponent2 { Str1 = "upd-c2-str1", Str2 = "c2-str2" } } };
+ ent1.Should().Be.EqualTo(expectedVer1);
+ ent2.Should().Be.EqualTo(expectedVer2);
+ }
+
+ [Test]
+ public async Task VerifyHistoryOfId5Async()
+ {
+ var ent1 = await (AuditReader().FindAsync(id5, 1)).ConfigureAwait(false);
+ var ent2 = await (AuditReader().FindAsync(id5, 2)).ConfigureAwait(false);
+ var expectedVer1 = new DefaultValueComponentTestEntity { Id = id5, Comp1 = new DefaultValueComponent1 { Str1 = null, Comp2 = new DefaultValueComponent2 { Str1 = "c2-str1", Str2 = null } } };
+ var expectedVer2 = new DefaultValueComponentTestEntity { Id = id5, Comp1 = new DefaultValueComponent1 { Str1 = null, Comp2 = new DefaultValueComponent2 { Str1 = "upd-c2-str1", Str2 = null } } };
+ ent1.Should().Be.EqualTo(expectedVer1);
+ ent2.Should().Be.EqualTo(expectedVer2);
+ }
+
+ [Test]
+ public async Task VerifyHistoryOfId6Async()
+ {
+ var ent1 = await (AuditReader().FindAsync(id6, 1)).ConfigureAwait(false);
+ var ent2 = await (AuditReader().FindAsync(id6, 2)).ConfigureAwait(false);
+ var expectedVer1 = new DefaultValueComponentTestEntity { Id = id6, Comp1 = new DefaultValueComponent1 { Str1 = null, Comp2 = null } };
+ var expectedVer2 = new DefaultValueComponentTestEntity { Id = id6, Comp1 = new DefaultValueComponent1 { Str1 = null, Comp2 = new DefaultValueComponent2 { Str1 = "upd-c2-str1", Str2 = null } } };
+ ent1.Should().Be.EqualTo(expectedVer1);
+ ent2.Should().Be.EqualTo(expectedVer2);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/Components/PropertiesGroupTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/Components/PropertiesGroupTest.cs
new file mode 100644
index 00000000..1258d73d
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/Components/PropertiesGroupTest.cs
@@ -0,0 +1,39 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using System.Collections.Generic;
+using NHibernate.Envers.Tests.Entities.Components;
+using NHibernate.Mapping;
+using NUnit.Framework;
+using SharpTestsEx;
+
+namespace NHibernate.Envers.Tests.Integration.Components
+{
+ using System.Threading.Tasks;
+ public partial class PropertiesGroupTest : TestBase
+ {
+
+ [Test]
+ public async Task VerifyHistoryOfUniquePropsEntityAsync()
+ {
+ var expected = new UniquePropsEntity {Id = auditedId, Data1 = "data1", Data2 = "data2"};
+ (await (AuditReader().FindAsync(auditedId, 1)).ConfigureAwait(false))
+ .Should().Be.EqualTo(expected);
+ }
+
+ [Test]
+ public async Task VerifyHistoryOfUniquePropsNotAuditedEntityAsync()
+ {
+ var expected = new UniquePropsNotAuditedEntity { Id = notAuditedId, Data1 = "data3"};
+ (await (AuditReader().FindAsync(notAuditedId, 2)).ConfigureAwait(false))
+ .Should().Be.EqualTo(expected);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/Components/Relations/ManyToOneInComponentTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/Components/Relations/ManyToOneInComponentTest.cs
new file mode 100644
index 00000000..491f9422
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/Components/Relations/ManyToOneInComponentTest.cs
@@ -0,0 +1,42 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using System.Collections.Generic;
+using NHibernate.Envers.Tests.Entities;
+using NHibernate.Envers.Tests.Entities.Components.Relations;
+using NUnit.Framework;
+
+namespace NHibernate.Envers.Tests.Integration.Components.Relations
+{
+ using System.Threading.Tasks;
+ public partial class ManyToOneInComponentTest : TestBase
+ {
+
+ [Test]
+ public async Task VerifyRevisionCountsAsync()
+ {
+ CollectionAssert.AreEqual(new[] { 2, 3 }, await (AuditReader().GetRevisionsAsync(typeof(ManyToOneComponentTestEntity), mtocte_id1)).ConfigureAwait(false));
+ }
+
+ [Test]
+ public async Task VerifyHistoryAsync()
+ {
+ var ste1 = await (Session.GetAsync(ste_id1)).ConfigureAwait(false);
+ var ste2 = await (Session.GetAsync(ste_id2)).ConfigureAwait(false);
+
+ var ver2 = new ManyToOneComponentTestEntity { Id = mtocte_id1, Comp1 = new ManyToOneComponent{Entity = ste1, Data = "data1" } };
+ var ver3 = new ManyToOneComponentTestEntity { Id = mtocte_id1, Comp1 = new ManyToOneComponent{Entity = ste2, Data = "data1" } };
+
+ Assert.IsNull(await (AuditReader().FindAsync(mtocte_id1, 1)).ConfigureAwait(false));
+ Assert.AreEqual(ver2, await (AuditReader().FindAsync(mtocte_id1, 2)).ConfigureAwait(false));
+ Assert.AreEqual(ver3, await (AuditReader().FindAsync(mtocte_id1, 3)).ConfigureAwait(false));
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/Components/Relations/NotAuditedManyToOneInComponentTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/Components/Relations/NotAuditedManyToOneInComponentTest.cs
new file mode 100644
index 00000000..47d49ed1
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/Components/Relations/NotAuditedManyToOneInComponentTest.cs
@@ -0,0 +1,40 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using System.Collections.Generic;
+using NHibernate.Envers.Tests.Entities;
+using NHibernate.Envers.Tests.Entities.Components.Relations;
+using NUnit.Framework;
+
+namespace NHibernate.Envers.Tests.Integration.Components.Relations
+{
+ using System.Threading.Tasks;
+ public partial class NotAuditedManyToOneInComponentTest : TestBase
+ {
+
+ [Test]
+ public async Task VerifyRevisionCountsAsync()
+ {
+ CollectionAssert.AreEqual(new[] { 1, 2 }, await (AuditReader().GetRevisionsAsync(typeof(NotAuditedManyToOneComponentTestEntity), mtocte_id1)).ConfigureAwait(false));
+ }
+
+ [Test]
+ public async Task VerifyHistoryAsync()
+ {
+ var ver1 = new NotAuditedManyToOneComponentTestEntity
+ {Id = mtocte_id1, Comp1 = new NotAuditedManyToOneComponent {Data = "data1"}};
+ var ver2 = new NotAuditedManyToOneComponentTestEntity
+ {Id = mtocte_id1, Comp1 = new NotAuditedManyToOneComponent {Data = "data2"}};
+
+ Assert.AreEqual(ver1, await (AuditReader().FindAsync(mtocte_id1, 1)).ConfigureAwait(false));
+ Assert.AreEqual(ver2, await (AuditReader().FindAsync(mtocte_id1, 2)).ConfigureAwait(false));
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/Components/Relations/OneToManyInComponentTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/Components/Relations/OneToManyInComponentTest.cs
new file mode 100644
index 00000000..205eb1e2
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/Components/Relations/OneToManyInComponentTest.cs
@@ -0,0 +1,45 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using System.Collections.Generic;
+using NHibernate.Envers.Tests.Entities;
+using NHibernate.Envers.Tests.Entities.Components.Relations;
+using NUnit.Framework;
+
+namespace NHibernate.Envers.Tests.Integration.Components.Relations
+{
+ using System.Threading.Tasks;
+ public partial class OneToManyInComponentTest : TestBase
+ {
+
+ [Test]
+ public async Task VerifyRevisionCountsAsync()
+ {
+ CollectionAssert.AreEqual(new[] { 2, 3 }, await (AuditReader().GetRevisionsAsync(typeof(OneToManyComponentTestEntity), otmcte_id1)).ConfigureAwait(false));
+ }
+
+ [Test]
+ public async Task VerifyHistoryOf1Async()
+ {
+ var ste1 = await (Session.GetAsync(ste_id1)).ConfigureAwait(false);
+ var ste2 = await (Session.GetAsync(ste_id2)).ConfigureAwait(false);
+
+ var ver2 = new OneToManyComponentTestEntity {Id = otmcte_id1, Comp1 = new OneToManyComponent {Data = "data1"}};
+ ver2.Comp1.Entities.Add(ste1);
+ var ver3 = new OneToManyComponentTestEntity {Id = otmcte_id1, Comp1 = new OneToManyComponent {Data = "data1"}};
+ ver3.Comp1.Entities.Add(ste1);
+ ver3.Comp1.Entities.Add(ste2);
+
+ Assert.IsNull(await (AuditReader().FindAsync(otmcte_id1, 1)).ConfigureAwait(false));
+ Assert.AreEqual(ver2, await (AuditReader().FindAsync(otmcte_id1, 2)).ConfigureAwait(false));
+ Assert.AreEqual(ver3, await (AuditReader().FindAsync(otmcte_id1, 3)).ConfigureAwait(false));
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/CustomType/CompositeCustomTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/CustomType/CompositeCustomTest.cs
new file mode 100644
index 00000000..f1404405
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/CustomType/CompositeCustomTest.cs
@@ -0,0 +1,39 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using System.Collections.Generic;
+using NHibernate.Envers.Tests.Entities.CustomType;
+using NUnit.Framework;
+
+namespace NHibernate.Envers.Tests.Integration.CustomType
+{
+ using System.Threading.Tasks;
+ public partial class CompositeCustomTest : TestBase
+ {
+
+ [Test]
+ public async Task VerifyRevisionCountAsync()
+ {
+ CollectionAssert.AreEquivalent(new[] { 1, 2, 3 }, await (AuditReader().GetRevisionsAsync(typeof(CompositeCustomTypeEntity), ccte_id)).ConfigureAwait(false));
+ }
+
+ [Test]
+ public async Task VerifyHistoryOfCccteAsync()
+ {
+ var rev1 = await (AuditReader().FindAsync(ccte_id, 1)).ConfigureAwait(false);
+ var rev2 = await (AuditReader().FindAsync(ccte_id, 2)).ConfigureAwait(false);
+ var rev3 = await (AuditReader().FindAsync(ccte_id, 3)).ConfigureAwait(false);
+
+ Assert.AreEqual(rev1.Component, new Component {Prop1 = "a", Prop2 = 1});
+ Assert.AreEqual(rev2.Component, new Component {Prop1 = "b", Prop2 = 1});
+ Assert.AreEqual(rev3.Component, new Component {Prop1 = "c", Prop2 = 3});
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/CustomType/ParametrizedCustomTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/CustomType/ParametrizedCustomTest.cs
new file mode 100644
index 00000000..0babdc74
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/CustomType/ParametrizedCustomTest.cs
@@ -0,0 +1,37 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using System.Collections.Generic;
+using NHibernate.Envers.Tests.Entities.CustomType;
+using NUnit.Framework;
+
+namespace NHibernate.Envers.Tests.Integration.CustomType
+{
+ using System.Threading.Tasks;
+ public partial class ParametrizedCustomTest : TestBase
+ {
+
+ [Test]
+ public async Task VerifyRevisionCountAsync()
+ {
+ CollectionAssert.AreEquivalent(new[] { 1, 2 }, await (AuditReader().GetRevisionsAsync(typeof(ParametrizedCustomTypeEntity), pcte_id)).ConfigureAwait(false));
+ }
+
+ [Test]
+ public async Task VerifyHistoryOfPcteAsync()
+ {
+ var rev1 = await (AuditReader().FindAsync(pcte_id, 1)).ConfigureAwait(false);
+ var rev2 = await (AuditReader().FindAsync(pcte_id, 2)).ConfigureAwait(false);
+
+ Assert.AreEqual("xUy", rev1.Str);
+ Assert.AreEqual("xVy", rev2.Str);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/CustomType/PrimitiveCustomTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/CustomType/PrimitiveCustomTest.cs
new file mode 100644
index 00000000..b14089db
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/CustomType/PrimitiveCustomTest.cs
@@ -0,0 +1,37 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using System.Collections.Generic;
+using NHibernate.Envers.Tests.Entities.CustomType;
+using NUnit.Framework;
+
+namespace NHibernate.Envers.Tests.Integration.CustomType
+{
+ using System.Threading.Tasks;
+ public partial class PrimitiveCustomTest : TestBase
+ {
+
+ [Test]
+ public async Task VerifyRevisionCountAsync()
+ {
+ CollectionAssert.AreEquivalent(new[] { 1, 2 }, await (AuditReader().GetRevisionsAsync(typeof(PrimitiveCustomTypeEntity), pctec_id)).ConfigureAwait(false));
+ }
+
+ [Test]
+ public async Task VerifyHistoryOfPctecAsync()
+ {
+ var rev1 = await (AuditReader().FindAsync(pctec_id, 1)).ConfigureAwait(false);
+ var rev2 = await (AuditReader().FindAsync(pctec_id, 2)).ConfigureAwait(false);
+
+ Assert.AreEqual('u', rev1.PrimitiveType.CharValue);
+ Assert.AreEqual('v', rev2.PrimitiveType.CharValue);
+ }
+ }
+}
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/Data/DateTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/Data/DateTest.cs
new file mode 100644
index 00000000..2dfb7f69
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/Data/DateTest.cs
@@ -0,0 +1,36 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using System;
+using NUnit.Framework;
+
+namespace NHibernate.Envers.Tests.Integration.Data
+{
+ using System.Threading.Tasks;
+ public partial class DateTest : TestBase
+ {
+
+ [Test]
+ public async Task VerifyRevisionCountAsync()
+ {
+ CollectionAssert.AreEquivalent(new[] { 1, 2 }, await (AuditReader().GetRevisionsAsync(typeof(DateTestEntity), id1)).ConfigureAwait(false));
+ }
+
+ [Test]
+ public async Task VerifyHistoryOfId1Async()
+ {
+ var ver1 = new DateTestEntity {Id = id1, Date = new DateTime(2000,1,2,3,4,5)};
+ var ver2 = new DateTestEntity { Id = id1, Date = new DateTime(2001,2,3,4,5,6) };
+
+ Assert.AreEqual(ver1, await (AuditReader().FindAsync(id1, 1)).ConfigureAwait(false));
+ Assert.AreEqual(ver2, await (AuditReader().FindAsync(id1, 2)).ConfigureAwait(false));
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/Data/EnumTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/Data/EnumTest.cs
new file mode 100644
index 00000000..d2bdd639
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/Data/EnumTest.cs
@@ -0,0 +1,35 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using NUnit.Framework;
+
+namespace NHibernate.Envers.Tests.Integration.Data
+{
+ using System.Threading.Tasks;
+ public partial class EnumTest : TestBase
+ {
+
+ [Test]
+ public async Task VerifyRevisionCountAsync()
+ {
+ CollectionAssert.AreEquivalent(new[] { 1, 2 }, await (AuditReader().GetRevisionsAsync(typeof(EnumTestEntity), id1)).ConfigureAwait(false));
+ }
+
+ [Test]
+ public async Task VerifyHistoryOfId1Async()
+ {
+ var ver1 = new EnumTestEntity {Id = id1, Enum1 = E1.X, Enum2 = E2.A};
+ var ver2 = new EnumTestEntity {Id = id1, Enum1 = E1.Y, Enum2 = E2.B};
+
+ Assert.AreEqual(ver1, await (AuditReader().FindAsync(id1, 1)).ConfigureAwait(false));
+ Assert.AreEqual(ver2, await (AuditReader().FindAsync(id1, 2)).ConfigureAwait(false));
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/Data/LobsTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/Data/LobsTest.cs
new file mode 100644
index 00000000..4b572b50
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/Data/LobsTest.cs
@@ -0,0 +1,35 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using NUnit.Framework;
+
+namespace NHibernate.Envers.Tests.Integration.Data
+{
+ using System.Threading.Tasks;
+ public partial class LobsTest : TestBase
+ {
+
+ [Test]
+ public async Task VerifyRevisionCountAsync()
+ {
+ CollectionAssert.AreEquivalent(new[] { 1, 2 }, await (AuditReader().GetRevisionsAsync(typeof(LobTestEntity), id1)).ConfigureAwait(false));
+ }
+
+ [Test]
+ public async Task VerifyHistoryOfId1Async()
+ {
+ var ver1 = new LobTestEntity { Id = id1, StringLob = "abc", ByteLob = new byte[] { 0, 1, 2 } };
+ var ver2 = new LobTestEntity { Id = id1, StringLob = "def", ByteLob = new byte[] { 3, 4, 5 } };
+
+ Assert.AreEqual(ver1, await (AuditReader().FindAsync(id1, 1)).ConfigureAwait(false));
+ Assert.AreEqual(ver2, await (AuditReader().FindAsync(id1, 2)).ConfigureAwait(false));
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/Data/SerializableTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/Data/SerializableTest.cs
new file mode 100644
index 00000000..a9054f32
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/Data/SerializableTest.cs
@@ -0,0 +1,35 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using NUnit.Framework;
+
+namespace NHibernate.Envers.Tests.Integration.Data
+{
+ using System.Threading.Tasks;
+ public partial class SerializableTest : TestBase
+ {
+
+ [Test]
+ public async Task VerifyRevisionCountAsync()
+ {
+ CollectionAssert.AreEquivalent(new[] { 1, 2 }, await (AuditReader().GetRevisionsAsync(typeof(SerializableTestEntity), id1)).ConfigureAwait(false));
+ }
+
+ [Test]
+ public async Task VerifyHistoryOfId1Async()
+ {
+ var ver1 = new SerializableTestEntity { Id = id1, Obj = new SerObj { Data = "d1" } };
+ var ver2 = new SerializableTestEntity { Id = id1, Obj = new SerObj { Data = "d2" } };
+
+ Assert.AreEqual(ver1, await (AuditReader().FindAsync(id1, 1)).ConfigureAwait(false));
+ Assert.AreEqual(ver2, await (AuditReader().FindAsync(id1, 2)).ConfigureAwait(false));
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/EntityNames/AuditedEntity/ReadEntityWithEntityNameTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/EntityNames/AuditedEntity/ReadEntityWithEntityNameTest.cs
new file mode 100644
index 00000000..472a40a6
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/EntityNames/AuditedEntity/ReadEntityWithEntityNameTest.cs
@@ -0,0 +1,66 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using NUnit.Framework;
+using SharpTestsEx;
+
+namespace NHibernate.Envers.Tests.Integration.EntityNames.AuditedEntity
+{
+ using System.Threading.Tasks;
+ public partial class ReadEntityWithEntityNameTest : TestBase
+ {
+
+ [Test]
+ public async Task ShouldRetrieveRevisionsWithEntityNameAsync()
+ {
+ var pers1Revs = await (AuditReader().GetRevisionsAsync("Personaje", id_pers1)).ConfigureAwait(false);
+ var pers2Revs = await (AuditReader().GetRevisionsAsync("Personaje", id_pers2)).ConfigureAwait(false);
+ var pers3Revs = await (AuditReader().GetRevisionsAsync("Personaje", id_pers3)).ConfigureAwait(false);
+
+ pers1Revs.Should().Have.Count.EqualTo(3);
+ pers2Revs.Should().Have.Count.EqualTo(2);
+ pers3Revs.Should().Have.Count.EqualTo(1);
+ }
+
+ [Test]
+ public async Task ShouldRetrieveAuditedEntityWithEntityNameAsync()
+ {
+ (await (AuditReader().FindAsync("Personaje", id_pers1, 1)).ConfigureAwait(false)).Should().Not.Be.Null();
+ (await (AuditReader().FindAsync("Personaje", id_pers1, 2)).ConfigureAwait(false)).Should().Not.Be.Null();
+ (await (AuditReader().FindAsync("Personaje", id_pers1, 3)).ConfigureAwait(false)).Should().Not.Be.Null();
+ }
+
+ [Test]
+ public async Task ShouldObtainEntityNameAuditedEntityWithEntityNameAsync()
+ {
+ var person1_1 = await (AuditReader().FindAsync("Personaje", id_pers1, 1)).ConfigureAwait(false);
+ var person1_2 = await (AuditReader().FindAsync("Personaje", id_pers1, 2)).ConfigureAwait(false);
+ var person1_3 = await (AuditReader().FindAsync("Personaje", id_pers1, 3)).ConfigureAwait(false);
+
+ var person1EN = AuditReader().GetEntityName(id_pers1, 1, person1_1);
+ var person2EN = AuditReader().GetEntityName(id_pers1, 2, person1_2);
+ var person3EN = AuditReader().GetEntityName(id_pers1, 3, person1_3);
+
+ person1EN.Should().Be.EqualTo("Personaje");
+ person2EN.Should().Be.EqualTo("Personaje");
+ person3EN.Should().Be.EqualTo("Personaje");
+ }
+
+ [Test]
+ public async Task ShouldRetrieveAuditedEntityWithEntityNameWithNewSessionAsync()
+ {
+ ForceNewSession();
+
+ (await (AuditReader().FindAsync("Personaje", id_pers1, 1)).ConfigureAwait(false)).Should().Not.Be.Null();
+ (await (AuditReader().FindAsync("Personaje", id_pers1, 2)).ConfigureAwait(false)).Should().Not.Be.Null();
+ (await (AuditReader().FindAsync("Personaje", id_pers1, 3)).ConfigureAwait(false)).Should().Not.Be.Null();
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/EntityNames/ManyToManyAudited/ReadEntityWithAuditedManyToManyTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/EntityNames/ManyToManyAudited/ReadEntityWithAuditedManyToManyTest.cs
new file mode 100644
index 00000000..5e52def1
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/EntityNames/ManyToManyAudited/ReadEntityWithAuditedManyToManyTest.cs
@@ -0,0 +1,63 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using System.Collections.Generic;
+using System.Linq;
+using NUnit.Framework;
+using SharpTestsEx;
+
+namespace NHibernate.Envers.Tests.Integration.EntityNames.ManyToManyAudited
+{
+ using System.Threading.Tasks;
+ using System.Threading;
+ public partial class ReadEntityWithAuditedManyToManyTest : TestBase
+ {
+
+ private async Task loadDataOnSessionAndAuditReaderAsync(CancellationToken cancellationToken = default(CancellationToken))
+ {
+ car1_2 = await (AuditReader().FindAsync(id_car1, 2, cancellationToken)).ConfigureAwait(false);
+ var car2_2 = await (AuditReader().FindAsync(id_car2, 2, cancellationToken)).ConfigureAwait(false);
+
+ // navigate through relations to load objects
+ foreach (var foo in from owner in car1_2.Owners from car in owner.Cars select car.Number)
+ {
+ }
+ foreach (var foo in from owner in car2_2.Owners from car in owner.Cars select car.Number)
+ {
+ }
+
+ car1 = await (Session.GetAsync(id_car1, cancellationToken)).ConfigureAwait(false);
+ person1_1 = (Person) await (AuditReader().FindAsync("Personaje", id_pers1, 1, cancellationToken)).ConfigureAwait(false);
+ }
+
+ private async Task checkEntityNamesAsync(CancellationToken cancellationToken = default(CancellationToken))
+ {
+ AuditReader().GetEntityName(id_pers1, 1, person1_1)
+ .Should().Be.EqualTo("Personaje");
+ AuditReader().GetEntityName(id_car1, 2, car1_2)
+ .Should().Be.EqualTo(await (Session.GetEntityNameAsync(car1, cancellationToken)).ConfigureAwait(false));
+ }
+
+ [Test]
+ public async Task ShouldGetEntityNameManyToManyWithEntityNameAsync()
+ {
+ await (loadDataOnSessionAndAuditReaderAsync()).ConfigureAwait(false);
+ await (checkEntityNamesAsync()).ConfigureAwait(false);
+ }
+
+ [Test]
+ public async Task ShouldGetEntityNameManyToManyWithEntityNameInNewSessionAsync()
+ {
+ ForceNewSession();
+ await (loadDataOnSessionAndAuditReaderAsync()).ConfigureAwait(false);
+ await (checkEntityNamesAsync()).ConfigureAwait(false);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/EntityNames/OneToManyAudited/ReadEntityWithAuditedCollectionTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/EntityNames/OneToManyAudited/ReadEntityWithAuditedCollectionTest.cs
new file mode 100644
index 00000000..6405744b
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/EntityNames/OneToManyAudited/ReadEntityWithAuditedCollectionTest.cs
@@ -0,0 +1,61 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using System.Collections.Generic;
+using System.Linq;
+using NUnit.Framework;
+using SharpTestsEx;
+
+namespace NHibernate.Envers.Tests.Integration.EntityNames.OneToManyAudited
+{
+ using System.Threading.Tasks;
+ using System.Threading;
+ public partial class ReadEntityWithAuditedCollectionTest : TestBase
+ {
+
+ private async Task loadDataOnSessionAndAuditReaderAsync(CancellationToken cancellationToken = default(CancellationToken))
+ {
+ person1_1 = (Person)await (AuditReader().FindAsync("Personaje", id_pers1, 1, cancellationToken)).ConfigureAwait(false);
+ car1_1 = await (AuditReader().FindAsync(id_car1, 2, cancellationToken)).ConfigureAwait(false);
+ var car2 = await (AuditReader().FindAsync(id_car2, 2, cancellationToken)).ConfigureAwait(false);
+
+ // navigate through relations to load objects
+ foreach (var foo in car1_1.Owners.Select(owner => owner.Name))
+ {
+ }
+ foreach (var foo in car2.Owners.Select(owner => owner.Name))
+ {
+ }
+ }
+
+ private async Task checkEntityNamesAsync(CancellationToken cancellationToken = default(CancellationToken))
+ {
+ AuditReader().GetEntityName(id_car1, 2, car1_1)
+ .Should().Be.EqualTo(await (Session.GetEntityNameAsync(await (Session.GetAsync(id_car1, cancellationToken)).ConfigureAwait(false), cancellationToken)).ConfigureAwait(false));
+ AuditReader().GetEntityName(id_pers1, 1, person1_1)
+ .Should().Be.EqualTo("Personaje");
+ }
+
+ [Test]
+ public async Task ShouldObtainEntityNameAuditedCollectionWithEntityNameAsync()
+ {
+ await (loadDataOnSessionAndAuditReaderAsync()).ConfigureAwait(false);
+ await (checkEntityNamesAsync()).ConfigureAwait(false);
+ }
+
+ [Test]
+ public async Task ShouldObtainEntityNameAuditedCollectionWithEntityNameInNewSessionAsync()
+ {
+ ForceNewSession();
+ await (loadDataOnSessionAndAuditReaderAsync()).ConfigureAwait(false);
+ await (checkEntityNamesAsync()).ConfigureAwait(false);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/EntityNames/OneToManyNotAudited/ReadEntityWithAuditedCollectionTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/EntityNames/OneToManyNotAudited/ReadEntityWithAuditedCollectionTest.cs
new file mode 100644
index 00000000..ddbb36f5
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/EntityNames/OneToManyNotAudited/ReadEntityWithAuditedCollectionTest.cs
@@ -0,0 +1,58 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using System.Collections.Generic;
+using System.Linq;
+using NUnit.Framework;
+using SharpTestsEx;
+
+namespace NHibernate.Envers.Tests.Integration.EntityNames.OneToManyNotAudited
+{
+ using System.Threading.Tasks;
+ using System.Threading;
+ public partial class ReadEntityWithAuditedCollectionTest : TestBase
+ {
+
+ private async Task loadDataOnSessionAndAuditReaderAsync(CancellationToken cancellationToken = default(CancellationToken))
+ {
+ car1_1 = await (AuditReader().FindAsync(id_car1, 2, cancellationToken)).ConfigureAwait(false);
+ var car2 = await (AuditReader().FindAsync(id_car2, 2, cancellationToken)).ConfigureAwait(false);
+
+ // navigate through relations to load objects
+ foreach (var foo in car1_1.Owners.Select(owner => owner.Name))
+ {
+ }
+ foreach (var foo in car2.Owners.Select(owner => owner.Name))
+ {
+ }
+ }
+
+ private async Task checkEntityNamesAsync(CancellationToken cancellationToken = default(CancellationToken))
+ {
+ AuditReader().GetEntityName(id_car1, 2, car1_1)
+ .Should().Be.EqualTo(await (Session.GetEntityNameAsync(await (Session.GetAsync(id_car1, cancellationToken)).ConfigureAwait(false), cancellationToken)).ConfigureAwait(false));
+ }
+
+ [Test]
+ public async Task ShouldObtainEntityNameAuditedCollectionWithEntityNameAsync()
+ {
+ await (loadDataOnSessionAndAuditReaderAsync()).ConfigureAwait(false);
+ await (checkEntityNamesAsync()).ConfigureAwait(false);
+ }
+
+ [Test]
+ public async Task ShouldObtainEntityNameAuditedCollectionWithEntityNameInNewSessionAsync()
+ {
+ ForceNewSession();
+ await (loadDataOnSessionAndAuditReaderAsync()).ConfigureAwait(false);
+ await (checkEntityNamesAsync()).ConfigureAwait(false);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/EntityNames/SingleAssociatedAudited/ReadEntityAssociatedAuditedTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/EntityNames/SingleAssociatedAudited/ReadEntityAssociatedAuditedTest.cs
new file mode 100644
index 00000000..9de8d851
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/EntityNames/SingleAssociatedAudited/ReadEntityAssociatedAuditedTest.cs
@@ -0,0 +1,64 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using NUnit.Framework;
+using SharpTestsEx;
+
+namespace NHibernate.Envers.Tests.Integration.EntityNames.SingleAssociatedAudited
+{
+ using System.Threading.Tasks;
+ using System.Threading;
+ public partial class ReadEntityAssociatedAuditedTest : TestBase
+ {
+
+ private async Task loadDataOnSessionAndAuditReaderAsync(CancellationToken cancellationToken = default(CancellationToken))
+ {
+ currentCar1 = await (Session.GetAsync(id_car1, cancellationToken)).ConfigureAwait(false);
+ currentPerson1 = (Person) await (Session.GetAsync("Personaje", id_pers1, cancellationToken)).ConfigureAwait(false);
+ car1 = await (AuditReader().FindAsync(id_car1, 1, cancellationToken)).ConfigureAwait(false);
+ person1 = car1.Owner;
+ }
+
+ private async Task checkEntitiesAsync(CancellationToken cancellationToken = default(CancellationToken))
+ {
+ currentPerson1.Age.Should().Not.Be.EqualTo(person1.Age);
+
+ var person2 = (Person)await (Session.GetAsync("Personaje", id_pers2, cancellationToken)).ConfigureAwait(false);
+ var car2 = await (AuditReader().FindAsync(id_car2, 2, cancellationToken)).ConfigureAwait(false);
+ var person2_1 = car2.Owner;
+ person2.Age.Should().Be.EqualTo(person2_1.Age);
+ }
+
+ private async Task checkEntityNamesAsync(CancellationToken cancellationToken = default(CancellationToken))
+ {
+ AuditReader().GetEntityName(id_car1, 1, car1)
+ .Should().Be.EqualTo(await (Session.GetEntityNameAsync(currentCar1, cancellationToken)).ConfigureAwait(false));
+ AuditReader().GetEntityName(id_pers1, 1, person1)
+ .Should().Be.EqualTo("Personaje");
+ }
+
+ [Test]
+ public async Task ShouldGetAssociationWithEntityNameAsync()
+ {
+ await (loadDataOnSessionAndAuditReaderAsync()).ConfigureAwait(false);
+ await (checkEntitiesAsync()).ConfigureAwait(false);
+ await (checkEntityNamesAsync()).ConfigureAwait(false);
+ }
+
+ [Test]
+ public async Task ShouldGetAssociationWithEntityNameInNewSessionAsync()
+ {
+ ForceNewSession();
+ await (loadDataOnSessionAndAuditReaderAsync()).ConfigureAwait(false);
+ await (checkEntitiesAsync()).ConfigureAwait(false);
+ await (checkEntityNamesAsync()).ConfigureAwait(false);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/EntityNames/SingleAssociatedAudited/SingleDomainObjectToMultipleTablesTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/EntityNames/SingleAssociatedAudited/SingleDomainObjectToMultipleTablesTest.cs
new file mode 100644
index 00000000..9eefb13d
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/EntityNames/SingleAssociatedAudited/SingleDomainObjectToMultipleTablesTest.cs
@@ -0,0 +1,35 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using NUnit.Framework;
+using SharpTestsEx;
+
+namespace NHibernate.Envers.Tests.Integration.EntityNames.SingleAssociatedAudited
+{
+ using System.Threading.Tasks;
+ public partial class SingleDomainObjectToMultipleTablesTest : TestBase
+ {
+
+ [Test]
+ public async Task VerifySingleDomainObjectToMultipleTablesMappingAsync()
+ {
+ var carVer1 = await (AuditReader().FindAsync(carId, 1)).ConfigureAwait(false);
+ var ownerVer1 = (Person)await (AuditReader().FindAsync("Personaje", ownerId, 1)).ConfigureAwait(false);
+ var driverVer1 = (Person)await (AuditReader().FindAsync("Driveraje", driverId, 1)).ConfigureAwait(false);
+
+ carVer1.Owner.Id.Should().Be.EqualTo(ownerVer1.Id);
+ carVer1.Driver.Id.Should().Be.EqualTo(driverVer1.Id);
+
+ ownerVer1.Name.Should().Be.EqualTo("Lukasz");
+ driverVer1.Name.Should().Be.EqualTo("Kinga");
+ carVer1.Number.Should().Be.EqualTo(1);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/EntityNames/SingleAssociatedNotAudited/ReadEntityAssociatedNotAuditedTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/EntityNames/SingleAssociatedNotAudited/ReadEntityAssociatedNotAuditedTest.cs
new file mode 100644
index 00000000..2b45f040
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/EntityNames/SingleAssociatedNotAudited/ReadEntityAssociatedNotAuditedTest.cs
@@ -0,0 +1,55 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using NUnit.Framework;
+using SharpTestsEx;
+
+namespace NHibernate.Envers.Tests.Integration.EntityNames.SingleAssociatedNotAudited
+{
+ using System.Threading.Tasks;
+ using System.Threading;
+ public partial class ReadEntityAssociatedNotAuditedTest : TestBase
+ {
+
+ private async Task loadDataOnSessionAndAuditReaderAsync(CancellationToken cancellationToken = default(CancellationToken))
+ {
+ currentPerson1 = (Person)await (Session.GetAsync("Personaje", id_pers1, cancellationToken)).ConfigureAwait(false);
+ person2 = (Person) await (Session.GetAsync("Personaje", id_pers2, cancellationToken)).ConfigureAwait(false);
+
+ currentCar1 = await (Session.GetAsync(id_car1, cancellationToken)).ConfigureAwait(false);
+
+ car1 = await (AuditReader().FindAsync(id_car1, 1, cancellationToken)).ConfigureAwait(false);
+ car2 = await (AuditReader().FindAsync(id_car2, 2, cancellationToken)).ConfigureAwait(false);
+ }
+
+ private async Task checkEntityNamesAsync(CancellationToken cancellationToken = default(CancellationToken))
+ {
+ AuditReader().GetEntityName(id_car1, 1, car1)
+ .Should().Be.EqualTo(await (Session.GetEntityNameAsync(currentCar1, cancellationToken)).ConfigureAwait(false));
+ }
+
+ [Test]
+ public async Task ShouldObtainEntityNameAssociationWithEntityNameAndNotAuditedModeAsync()
+ {
+ await (loadDataOnSessionAndAuditReaderAsync()).ConfigureAwait(false);
+ checkEntities();
+ await (checkEntityNamesAsync()).ConfigureAwait(false);
+ }
+
+ [Test]
+ public async Task ShouldtestObtainEntityNameAssociationWithEntityNameAndNotAuditedModeInNewSessionAsync()
+ {
+ ForceNewSession();
+ await (loadDataOnSessionAndAuditReaderAsync()).ConfigureAwait(false);
+ checkEntities();
+ await (checkEntityNamesAsync()).ConfigureAwait(false);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/Flush/DoubleFlushAddDelTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/Flush/DoubleFlushAddDelTest.cs
new file mode 100644
index 00000000..a8c58a4c
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/Flush/DoubleFlushAddDelTest.cs
@@ -0,0 +1,33 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using System.Collections.Generic;
+using NHibernate.Envers.Tests.Entities;
+using NUnit.Framework;
+
+namespace NHibernate.Envers.Tests.Integration.Flush
+{
+ using System.Threading.Tasks;
+ public partial class DoubleFlushAddDelTest : TestBase
+ {
+
+ [Test]
+ public async Task VerifyRevisionCountAsync()
+ {
+ CollectionAssert.IsEmpty(await (AuditReader().GetRevisionsAsync(typeof(StrTestEntity), id1)).ConfigureAwait(false));
+ }
+
+ [Test]
+ public async Task VerifyHistoryOfId1Async()
+ {
+ Assert.IsNull(await (AuditReader().FindAsync(id1, 1)).ConfigureAwait(false));
+ }
+ }
+}
\ No newline at end of file
diff --git a/Src/NHibernate.Envers.Tests/Async/Integration/Flush/DoubleFlushAddModTest.cs b/Src/NHibernate.Envers.Tests/Async/Integration/Flush/DoubleFlushAddModTest.cs
new file mode 100644
index 00000000..0d018857
--- /dev/null
+++ b/Src/NHibernate.Envers.Tests/Async/Integration/Flush/DoubleFlushAddModTest.cs
@@ -0,0 +1,51 @@
+//------------------------------------------------------------------------------
+//