Skip to content

Conversation

@SimonCropp
Copy link
Contributor

@SimonCropp SimonCropp commented Nov 22, 2025

Auto-created Ticket

#473

PR Type

Enhancement


Description

  • Shortened test method names by removing redundant "AggregateContractToCommand" prefix

  • Simplified test names to focus on core functionality being tested

  • Added IgnoreParameters() to verification call for more flexible test assertions


Diagram Walkthrough

flowchart LR
  A["Test Method Names"] -->|Remove Redundant Prefix| B["Shorter Names"]
  C["Verification Call"] -->|Add IgnoreParameters| D["Flexible Assertions"]
Loading

File Walkthrough

Relevant files
Tests
AggregateCommandsTests.cs
Simplify test names and enhance verification                         

src/Extensions/test/Eventuous.Tests.Extensions.AspNetCore/AggregateCommandsTests.cs

  • Renamed four test methods to remove "AggregateContractToCommand"
    prefix, keeping only the essential parts (e.g.,
    MapAggregateContractToCommandExplicitlyMapContractExplicitly)
  • Added .IgnoreParameters() call to the VerifyJson() assertion in the
    Execute method for more flexible test verification
+6/-5     

@qodo-free-for-open-source-projects
Copy link
Contributor

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
🟢
No codebase code duplication found No new components were introduced in the PR code
Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@qodo-free-for-open-source-projects
Copy link
Contributor

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
General
Simplify exception test using lambda

Refactor the MapContractExplicitlyWithoutRouteWithWrongGenericAttr test to use a
lambda expression directly within Assert.Throws instead of a separate local
function for better readability.

src/Extensions/test/Eventuous.Tests.Extensions.AspNetCore/AggregateCommandsTests.cs [50-67]

     [Test]
     public void MapContractExplicitlyWithoutRouteWithWrongGenericAttr() {
-        Assert.Throws<InvalidOperationException>(Act);
-
-        return;
-
-        void Act() {
-            _ = new ServerFixture(
+        Assert.Throws<InvalidOperationException>(
+            () => _ = new ServerFixture(
                 factory,
                 _ => { },
 #pragma warning disable EVTA001
                 app => app
                     .MapCommands<BookingState>()
                     .MapCommand<ImportBookingHttp3, ImportBooking>(Enricher.EnrichCommand)
 #pragma warning restore EVTA001
-            );
-        }
+            )
+        );
     }
  • Apply / Chat
Suggestion importance[1-10]: 4

__

Why: The suggestion correctly proposes refactoring the test to use a lambda, which improves code conciseness and readability, but it is a minor stylistic improvement.

Low
  • More

@github-actions
Copy link

Test Results

 51 files  + 34   51 suites  +34   32m 44s ⏱️ + 20m 42s
279 tests + 10  279 ✅ + 10  0 💤 ±0  0 ❌ ±0 
840 runs  +560  840 ✅ +560  0 💤 ±0  0 ❌ ±0 

Results for commit 4be8b44. ± Comparison against base commit 20e513c.

This pull request removes 9 and adds 19 tests. Note that renamed tests count towards both.
Eventuous.Tests.Azure.ServiceBus.IsSerialisableByServiceBus ‑ Passes(11/15/2025 4:21:41 PM +00:00)
Eventuous.Tests.Azure.ServiceBus.IsSerialisableByServiceBus ‑ Passes(11/15/2025 4:21:41 PM)
Eventuous.Tests.Azure.ServiceBus.IsSerialisableByServiceBus ‑ Passes(9f9500c2-a728-4355-9693-4b0bf3e9ba06)
Eventuous.Tests.Extensions.AspNetCore.AggregateCommandsTests ‑ MapAggregateContractToCommandExplicitly
Eventuous.Tests.Extensions.AspNetCore.AggregateCommandsTests ‑ MapAggregateContractToCommandExplicitlyWithoutRoute
Eventuous.Tests.Extensions.AspNetCore.AggregateCommandsTests ‑ MapAggregateContractToCommandExplicitlyWithoutRouteWithGenericAttr
Eventuous.Tests.Extensions.AspNetCore.AggregateCommandsTests ‑ MapAggregateContractToCommandExplicitlyWithoutRouteWithWrongGenericAttr
Eventuous.Tests.Subscriptions.SequenceTests ‑ ShouldReturnFirstBefore(CommitPosition { Position: 0, Sequence: 1, Timestamp: 2025-11-15T16:21:42.3737910+00:00 }, CommitPosition { Position: 0, Sequence: 2, Timestamp: 2025-11-15T16:21:42.3737910+00:00 }, CommitPosition { Position: 0, Sequence: 4, Timestamp: 2025-11-15T16:21:42.3737910+00:00 }, CommitPosition { Position: 0, Sequence: 6, Timestamp: 2025-11-15T16:21:42.3737910+00:00 }, CommitPosition { Position: 0, Sequence: 2, Timestamp: 2025-11-15T16:21:42.3737910+00:00 })
Eventuous.Tests.Subscriptions.SequenceTests ‑ ShouldReturnFirstBefore(CommitPosition { Position: 0, Sequence: 1, Timestamp: 2025-11-15T16:21:42.3737910+00:00 }, CommitPosition { Position: 0, Sequence: 2, Timestamp: 2025-11-15T16:21:42.3737910+00:00 }, CommitPosition { Position: 0, Sequence: 6, Timestamp: 2025-11-15T16:21:42.3737910+00:00 }, CommitPosition { Position: 0, Sequence: 8, Timestamp: 2025-11-15T16:21:42.3737910+00:00 }, CommitPosition { Position: 0, Sequence: 2, Timestamp: 2025-11-15T16:21:42.3737910+00:00 })
Eventuous.Tests.Azure.ServiceBus.IsSerialisableByServiceBus ‑ Passes(11/22/2025 11:56:57 AM +00:00)
Eventuous.Tests.Azure.ServiceBus.IsSerialisableByServiceBus ‑ Passes(11/22/2025 11:56:57 AM)
Eventuous.Tests.Azure.ServiceBus.IsSerialisableByServiceBus ‑ Passes(11/22/2025 11:57:01 AM +00:00)
Eventuous.Tests.Azure.ServiceBus.IsSerialisableByServiceBus ‑ Passes(11/22/2025 11:57:01 AM)
Eventuous.Tests.Azure.ServiceBus.IsSerialisableByServiceBus ‑ Passes(11/22/2025 11:57:10 AM +00:00)
Eventuous.Tests.Azure.ServiceBus.IsSerialisableByServiceBus ‑ Passes(11/22/2025 11:57:10 AM)
Eventuous.Tests.Azure.ServiceBus.IsSerialisableByServiceBus ‑ Passes(4e62d22d-09a3-4709-bd6a-bc7509308bd2)
Eventuous.Tests.Azure.ServiceBus.IsSerialisableByServiceBus ‑ Passes(c744b2e0-1dff-4bd0-b61f-4026a38bc5fe)
Eventuous.Tests.Azure.ServiceBus.IsSerialisableByServiceBus ‑ Passes(c7458917-30b7-4c95-aaf5-a82c99bed94b)
Eventuous.Tests.Extensions.AspNetCore.AggregateCommandsTests ‑ MapContractExplicitly
…

@alexeyzimarev alexeyzimarev merged commit ebb7d90 into Eventuous:dev Nov 22, 2025
5 checks passed
alexeyzimarev pushed a commit that referenced this pull request Nov 22, 2025
alexeyzimarev added a commit that referenced this pull request Nov 24, 2025
* Added ability to specify SessionId and ReplyToSessionId for the producer, along with support for ServiceBusSessionProcessor for the consumer
* handle unsubscribe for session processor
* make verified file paths shorter (#472)
* Updated TestContainers for the emulator
* Remove duplicate code

Co-authored-by: qodo-merge-for-open-source[bot] <189517486+qodo-merge-for-open-source[bot]@users.noreply.github.com>
Co-authored-by: alexey-troshkin-xpress <alexey.troshkin@xpress.com.ph>
Co-authored-by: Simon Cropp <simon.cropp@gmail.com>
Co-authored-by: qodo-merge-for-open-source[bot] <189517486+qodo-merge-for-open-source[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants