Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:

- name: Post Coverage Comment
if: github.event_name == 'pull_request'
uses: marocchino/sticky-pull-request-comment@v2
uses: marocchino/sticky-pull-request-comment@v3
with:
path: coverage_report/SummaryGithub.md

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<PackageId>DannyGoodacre.Cqrs.Testing</PackageId>
<Version>0.6.0</Version>
<Version>0.7.0</Version>
<Authors>Danny Goodacre</Authors>
<Description>Testing abstractions and base classes for verifying implementations of DannyGoodacre.Cqrs.</Description>
<RepositoryUrl>https://github.com/dannygoodacre/DannyGoodacre.Core</RepositoryUrl>
Expand Down
2 changes: 1 addition & 1 deletion src/DannyGoodacre.Cqrs/CommandHandlerBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ protected virtual void Validate(ValidationState validationState, TCommand comman
/// <param name="command">The command to validate and process.</param>
/// <param name="cancellationToken">A <see cref="CancellationToken"/> to observe while performing the operation.</param>
/// <returns>A <see cref="Result"/> indicating the outcome of the operation.</returns>
public async virtual Task<TResult> ExecuteAsync(TCommand command, CancellationToken cancellationToken = default)
protected async virtual Task<TResult> ExecuteAsync(TCommand command, CancellationToken cancellationToken = default)
{
var validationState = new ValidationState();

Expand Down
2 changes: 1 addition & 1 deletion src/DannyGoodacre.Cqrs/DannyGoodacre.Cqrs.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<PackageId>DannyGoodacre.Cqrs</PackageId>
<Version>0.6.0</Version>
<Version>0.7.0</Version>
<Authors>Danny Goodacre</Authors>
<Description>A lightweight CQRS and clean architecture foundation library including state and transaction control.</Description>
<RepositoryUrl>https://github.com/dannygoodacre/DannyGoodacre.Core</RepositoryUrl>
Expand Down
2 changes: 1 addition & 1 deletion src/DannyGoodacre.Cqrs/QueryHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ protected virtual void Validate(ValidationState validationState, TQuery queryReq
/// <param name="query">The query to validate and process.</param>
/// <param name="cancellationToken">A <see cref="CancellationToken"/> to observe while performing the operation.</param>
/// <returns>A <see cref="Result{T}"/> indicating the outcome of the operation.</returns>
public async Task<Result<TResult>> ExecuteAsync(TQuery query, CancellationToken cancellationToken = default)
protected async Task<Result<TResult>> ExecuteAsync(TQuery query, CancellationToken cancellationToken = default)
{
var validationState = new ValidationState();

Expand Down
2 changes: 1 addition & 1 deletion src/DannyGoodacre.Cqrs/StateCommandHandlerBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ internal StateCommandHandlerBase(ILogger logger, IStateUnit stateUnit) : base(lo

private IStateUnit StateUnit { get; }

public async override Task<TResult> ExecuteAsync(TCommand command, CancellationToken cancellationToken = default)
protected async override Task<TResult> ExecuteAsync(TCommand command, CancellationToken cancellationToken = default)
{
try
{
Expand Down
2 changes: 1 addition & 1 deletion src/DannyGoodacre.Cqrs/TransactionCommandHandlerBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ internal TransactionCommandHandlerBase(ILogger logger, ITransactionUnit transact
/// </remarks>
protected virtual int ExpectedChanges { get; set; } = -1;

public async override Task<TResult> ExecuteAsync(TCommand command, CancellationToken cancellationToken = default)
protected async override Task<TResult> ExecuteAsync(TCommand command, CancellationToken cancellationToken = default)
{
await using ITransaction transaction = await TransactionUnit.BeginTransactionAsync(cancellationToken);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<PackageId>DannyGoodacre.Primitives</PackageId>
<Version>0.6.0</Version>
<Version>0.7.0</Version>
<Authors>Danny Goodacre</Authors>
<Description>A lightweight primitives library providing Result types and a structured validation state for method responses.</Description>
<RepositoryUrl>https://github.com/dannygoodacre/DannyGoodacre.Core</RepositoryUrl>
Expand Down
2 changes: 1 addition & 1 deletion src/DannyGoodacre.Testing/DannyGoodacre.Testing.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<PackageId>DannyGoodacre.Testing</PackageId>
<Version>0.6.0</Version>
<Version>0.7.0</Version>
<Authors>Danny Goodacre</Authors>
<Description>A lightweight testing foundation library.</Description>
<RepositoryUrl>https://github.com/dannygoodacre/DannyGoodacre.Core</RepositoryUrl>
Expand Down
5 changes: 4 additions & 1 deletion tests/DannyGoodacre.Cqrs.Tests/CommandHandlerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ protected override void Validate(ValidationState validationState, TestCommand co

protected override Task<Result> InternalExecuteAsync(TestCommand command, CancellationToken cancellationToken = default)
=> _testInternalExecuteAsync(command, cancellationToken);

public Task<Result> TestExecuteAsync(TestCommand command, CancellationToken cancellationToken)
=> ExecuteAsync(command, cancellationToken);
}

private const string TestName = "Test Command Handler";
Expand All @@ -31,7 +34,7 @@ protected override Task<Result> InternalExecuteAsync(TestCommand command, Cancel

protected override string CommandName => TestName;

protected override Task<Result> Act() => CommandHandler.ExecuteAsync(_testCommand, TestCancellationToken);
protected override Task<Result> Act() => CommandHandler.TestExecuteAsync(_testCommand, TestCancellationToken);

[SetUp]
public void SetUp()
Expand Down
7 changes: 5 additions & 2 deletions tests/DannyGoodacre.Cqrs.Tests/QueryHandlerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ public sealed class TestQueryHandler(ILogger logger) : QueryHandler<TestQuery, i
protected override void Validate(ValidationState validationState, TestQuery query)
=> _testValidate(validationState, query);

protected override Task<Result<int>> InternalExecuteAsync(TestQuery query, CancellationToken cancellationToken)
protected override Task<Result<int>> InternalExecuteAsync(TestQuery query, CancellationToken cancellationToken = default)
=> _testInternalExecuteAsync(query, cancellationToken);

public Task<Result<int>> TestExecuteAsync(TestQuery query, CancellationToken cancellationToken = default)
=> ExecuteAsync(query, cancellationToken);
}

private const string TestName = "Test Query Handler";
Expand All @@ -33,7 +36,7 @@ protected override Task<Result<int>> InternalExecuteAsync(TestQuery query, Cance

protected override string QueryName => TestName;

protected override Task<Result<int>> Act() => QueryHandler.ExecuteAsync(_testQuery, CancellationToken);
protected override Task<Result<int>> Act() => QueryHandler.TestExecuteAsync(_testQuery, CancellationToken);

[SetUp]
public void SetUp()
Expand Down
5 changes: 4 additions & 1 deletion tests/DannyGoodacre.Cqrs.Tests/StateCommandHandlerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ protected override void Validate(ValidationState validationState, TestCommand co

protected override Task<Result> InternalExecuteAsync(TestCommand command, CancellationToken cancellationToken = default)
=> _testInternalExecuteAsync(command, cancellationToken);

public Task<Result> TestExecuteAsync(TestCommand command, CancellationToken cancellationToken = default)
=> ExecuteAsync(command, cancellationToken);
}

private const string TestName = "Test State Command Handler";
Expand All @@ -32,7 +35,7 @@ protected override Task<Result> InternalExecuteAsync(TestCommand command, Cancel

protected override string CommandName => TestName;

protected override Task<Result> Act() => CommandHandler.ExecuteAsync(_testCommand, TestCancellationToken);
protected override Task<Result> Act() => CommandHandler.TestExecuteAsync(_testCommand, TestCancellationToken);

[SetUp]
public void SetUp()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ protected override void Validate(ValidationState validationState, TestCommand co

protected override Task<Result<int>> InternalExecuteAsync(TestCommand command, CancellationToken cancellationToken = default)
=> _testInternalExecuteAsync(command, cancellationToken);

public Task<Result<int>> TestExecuteAsync(TestCommand command, CancellationToken cancellationToken = default)
=> ExecuteAsync(command, cancellationToken);
}

private const string TestName = "Test State Command Handler";
Expand All @@ -34,7 +37,7 @@ protected override Task<Result<int>> InternalExecuteAsync(TestCommand command, C

protected override string CommandName => TestName;

protected override Task<Result<int>> Act() => CommandHandler.ExecuteAsync(_testCommand, TestCancellationToken);
protected override Task<Result<int>> Act() => CommandHandler.TestExecuteAsync(_testCommand, TestCancellationToken);

[SetUp]
public void SetUp()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ public sealed class TestTransactionCommandHandler(ILogger logger, ITransactionUn

protected override Task<Result> InternalExecuteAsync(TestCommand command, CancellationToken cancellationToken = default)
=> _internalExecuteAsync(command, cancellationToken);

public Task<Result> TestExecuteAsync(TestCommand command, CancellationToken cancellationToken = default)
=> ExecuteAsync(command, cancellationToken);
}

private const string TestName = "Test Transaction Command Handler";
Expand All @@ -34,7 +37,7 @@ protected override Task<Result> InternalExecuteAsync(TestCommand command, Cancel

protected override string CommandName => TestName;

protected override Task<Result> Act() => CommandHandler.ExecuteAsync(_testCommand, TestCancellationToken);
protected override Task<Result> Act() => CommandHandler.TestExecuteAsync(_testCommand, TestCancellationToken);

protected override int TestActualChanges => _testActualChanges;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ public sealed class TestTransactionCommandHandler(ILogger logger, ITransactionUn

protected override Task<Result<int>> InternalExecuteAsync(TestCommand command, CancellationToken cancellationToken = default)
=> _internalExecuteAsync(command, cancellationToken);

public Task<Result<int>> TestExecuteAsync(TestCommand command, CancellationToken cancellationToken = default)
=> ExecuteAsync(command, cancellationToken);
}

private const string TestName = "Test Transaction Command Handler";
Expand All @@ -36,7 +39,7 @@ protected override Task<Result<int>> InternalExecuteAsync(TestCommand command, C

protected override string CommandName => TestName;

protected override Task<Result<int>> Act() => CommandHandler.ExecuteAsync(_testCommand, TestCancellationToken);
protected override Task<Result<int>> Act() => CommandHandler.TestExecuteAsync(_testCommand, TestCancellationToken);

protected override int TestActualChanges => _testActualChanges;

Expand Down