-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fd99653
commit 9952932
Showing
637 changed files
with
18,512 additions
and
333 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"version": 1, | ||
"isRoot": true, | ||
"tools":{ | ||
"csharpasyncgenerator.tool": { | ||
"version": "0.21.1", | ||
"commands": [ | ||
"async-generator" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
Src/NHibernate.Envers.Tests/Async/Integration/AccessType/FieldAccessTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
//------------------------------------------------------------------------------ | ||
// <auto-generated> | ||
// This code was generated by AsyncGenerator. | ||
// | ||
// Changes to this file may cause incorrect behavior and will be lost if | ||
// the code is regenerated. | ||
// </auto-generated> | ||
//------------------------------------------------------------------------------ | ||
|
||
|
||
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<FieldAccessEntity>(id, 1)).ConfigureAwait(false)); | ||
Assert.AreEqual(ver2, await (AuditReader().FindAsync<FieldAccessEntity>(id, 2)).ConfigureAwait(false)); | ||
} | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
Src/NHibernate.Envers.Tests/Async/Integration/AccessType/ImmutableClassAccessTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
//------------------------------------------------------------------------------ | ||
// <auto-generated> | ||
// This code was generated by AsyncGenerator. | ||
// | ||
// Changes to this file may cause incorrect behavior and will be lost if | ||
// the code is regenerated. | ||
// </auto-generated> | ||
//------------------------------------------------------------------------------ | ||
|
||
|
||
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>(country.Code)).ConfigureAwait(false); | ||
Assert.AreEqual(country, country1); | ||
|
||
var history = await (AuditReader().FindAsync<Country>(country1.Code, 1)).ConfigureAwait(false); | ||
Assert.AreEqual(country, history); | ||
} | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
Src/NHibernate.Envers.Tests/Async/Integration/AccessType/MixedAccessTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
//------------------------------------------------------------------------------ | ||
// <auto-generated> | ||
// This code was generated by AsyncGenerator. | ||
// | ||
// Changes to this file may cause incorrect behavior and will be lost if | ||
// the code is regenerated. | ||
// </auto-generated> | ||
//------------------------------------------------------------------------------ | ||
|
||
|
||
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<MixedAccessEntity>(id1, 1)).ConfigureAwait(false); | ||
var rev2 = await (AuditReader().FindAsync<MixedAccessEntity>(id1, 2)).ConfigureAwait(false); | ||
|
||
Assert.IsTrue(rev1.IsDataSet); | ||
Assert.IsTrue(rev2.IsDataSet); | ||
|
||
Assert.AreEqual(ver1, rev1); | ||
Assert.AreEqual(ver2, rev2); | ||
} | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
Src/NHibernate.Envers.Tests/Async/Integration/AccessType/NoSetterTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
//------------------------------------------------------------------------------ | ||
// <auto-generated> | ||
// This code was generated by AsyncGenerator. | ||
// | ||
// Changes to this file may cause incorrect behavior and will be lost if | ||
// the code is regenerated. | ||
// </auto-generated> | ||
//------------------------------------------------------------------------------ | ||
|
||
|
||
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<NoSetterEntity>(id1, 1)).ConfigureAwait(false); | ||
var rev2 = await (AuditReader().FindAsync<NoSetterEntity>(id1, 2)).ConfigureAwait(false); | ||
|
||
Assert.AreEqual("data", rev1.Data); | ||
Assert.AreEqual("data2", rev2.Data); | ||
} | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
Src/NHibernate.Envers.Tests/Async/Integration/AccessType/PropertyAccessTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
//------------------------------------------------------------------------------ | ||
// <auto-generated> | ||
// This code was generated by AsyncGenerator. | ||
// | ||
// Changes to this file may cause incorrect behavior and will be lost if | ||
// the code is regenerated. | ||
// </auto-generated> | ||
//------------------------------------------------------------------------------ | ||
|
||
|
||
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<PropertyAccessEntity>(id, 1)).ConfigureAwait(false)).Data); | ||
Assert.AreEqual("second", (await (AuditReader().FindAsync<PropertyAccessEntity>(id, 2)).ConfigureAwait(false)).Data); | ||
} | ||
} | ||
} |
Oops, something went wrong.