diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e8775e9..63b65a37 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,21 @@ All notable changes to this project are documented in this file, grouped by date The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). +## [2026-07-17] + +### Changed + +- **Deps**: bumped `NSubstitute` from `5.3.0` to `6.0.0` (major). Fixed three test files + (`CreateCashierCommandHandlerTests`, `UpdateCashierCommandHandlerTests`, `CreateInvoiceCommandHandlerTests`) + that cast `CallInfo`'s indexer directly (`(T)x[0]`), which no longer compiles under 6.0's nullable-annotated + public API — switched to the null-safe `x.ArgAt(0)` extension instead. + +### Skipped + +- **Deps**: `Refitter.MSBuild` `2.0.0` → `2.1.0` was left in place — 2.1.0 refactored the MSBuild task itself + (upstream decoupled the CLI binary from the task) and fails code generation locally with + `MissingMethodException: System.Text.ValueStringBuilder.AsSpan()`. Needs an upstream fix before retrying. + ## [2026-07-16] ### Changed diff --git a/Directory.Packages.props b/Directory.Packages.props index bb913544..0485b8ab 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -97,7 +97,7 @@ - + diff --git a/tests/AppDomain.Tests/Unit/Cashier/CreateCashierCommandHandlerTests.cs b/tests/AppDomain.Tests/Unit/Cashier/CreateCashierCommandHandlerTests.cs index 4bb7861f..0ac12adc 100644 --- a/tests/AppDomain.Tests/Unit/Cashier/CreateCashierCommandHandlerTests.cs +++ b/tests/AppDomain.Tests/Unit/Cashier/CreateCashierCommandHandlerTests.cs @@ -18,10 +18,10 @@ public async Task Handle_WithValidCommand_ShouldCreateCashierAndReturnResult() messagingMock.InvokeCommandAsync(Arg.Any(), Arg.Any()) .Returns(x => new AppDomain.Cashiers.Data.Entities.Cashier { - TenantId = ((CreateCashierCommandHandler.DbCommand)x[0]).Cashier.TenantId, - CashierId = ((CreateCashierCommandHandler.DbCommand)x[0]).Cashier.CashierId, - Name = ((CreateCashierCommandHandler.DbCommand)x[0]).Cashier.Name, - Email = ((CreateCashierCommandHandler.DbCommand)x[0]).Cashier.Email, + TenantId = x.ArgAt(0).Cashier.TenantId, + CashierId = x.ArgAt(0).Cashier.CashierId, + Name = x.ArgAt(0).Cashier.Name, + Email = x.ArgAt(0).Cashier.Email, CreatedDateUtc = DateTime.UtcNow, UpdatedDateUtc = DateTime.UtcNow, Version = 12345 // Some mock xmin value @@ -65,10 +65,10 @@ public async Task Handle_ShouldGenerateUniqueGuidForEachCall() messagingMock.InvokeCommandAsync(Arg.Any(), Arg.Any()) .Returns(x => new AppDomain.Cashiers.Data.Entities.Cashier { - TenantId = ((CreateCashierCommandHandler.DbCommand)x[0]).Cashier.TenantId, - CashierId = ((CreateCashierCommandHandler.DbCommand)x[0]).Cashier.CashierId, - Name = ((CreateCashierCommandHandler.DbCommand)x[0]).Cashier.Name, - Email = ((CreateCashierCommandHandler.DbCommand)x[0]).Cashier.Email, + TenantId = x.ArgAt(0).Cashier.TenantId, + CashierId = x.ArgAt(0).Cashier.CashierId, + Name = x.ArgAt(0).Cashier.Name, + Email = x.ArgAt(0).Cashier.Email, CreatedDateUtc = DateTime.UtcNow, UpdatedDateUtc = DateTime.UtcNow, Version = 12345 // Some mock xmin value diff --git a/tests/AppDomain.Tests/Unit/Cashier/UpdateCashierCommandHandlerTests.cs b/tests/AppDomain.Tests/Unit/Cashier/UpdateCashierCommandHandlerTests.cs index 87461d88..2437e654 100644 --- a/tests/AppDomain.Tests/Unit/Cashier/UpdateCashierCommandHandlerTests.cs +++ b/tests/AppDomain.Tests/Unit/Cashier/UpdateCashierCommandHandlerTests.cs @@ -21,10 +21,10 @@ public async Task Handle_WithValidCashier_ShouldUpdateAndReturnResult() messagingMock.InvokeCommandAsync(Arg.Any(), Arg.Any()) .Returns(x => new CashierEntity { - TenantId = ((UpdateCashierCommandHandler.DbCommand)x[0]).TenantId, - CashierId = ((UpdateCashierCommandHandler.DbCommand)x[0]).CashierId, - Name = ((UpdateCashierCommandHandler.DbCommand)x[0]).Name, - Email = ((UpdateCashierCommandHandler.DbCommand)x[0]).Email, + TenantId = x.ArgAt(0).TenantId, + CashierId = x.ArgAt(0).CashierId, + Name = x.ArgAt(0).Name, + Email = x.ArgAt(0).Email, CreatedDateUtc = DateTime.UtcNow, UpdatedDateUtc = DateTime.UtcNow, Version = 2 // Version should be incremented after update @@ -99,9 +99,9 @@ public async Task Handle_WithNullEmail_ShouldReturnNotUpdatedForEmail() messagingMock.InvokeCommandAsync(Arg.Any(), Arg.Any()) .Returns(x => new CashierEntity { - TenantId = ((UpdateCashierCommandHandler.DbCommand)x[0]).TenantId, - CashierId = ((UpdateCashierCommandHandler.DbCommand)x[0]).CashierId, - Name = ((UpdateCashierCommandHandler.DbCommand)x[0]).Name, + TenantId = x.ArgAt(0).TenantId, + CashierId = x.ArgAt(0).CashierId, + Name = x.ArgAt(0).Name, Email = "Not Updated", // When email is null in command, it should remain unchanged (original value) CreatedDateUtc = DateTime.UtcNow, UpdatedDateUtc = DateTime.UtcNow, diff --git a/tests/AppDomain.Tests/Unit/Invoices/CreateInvoiceCommandHandlerTests.cs b/tests/AppDomain.Tests/Unit/Invoices/CreateInvoiceCommandHandlerTests.cs index 23bb9662..d6c1fb12 100644 --- a/tests/AppDomain.Tests/Unit/Invoices/CreateInvoiceCommandHandlerTests.cs +++ b/tests/AppDomain.Tests/Unit/Invoices/CreateInvoiceCommandHandlerTests.cs @@ -21,14 +21,14 @@ public async Task Handle_WithValidCommand_ShouldCreateInvoiceAndReturnResult() messagingMock.InvokeCommandAsync(Arg.Any(), Arg.Any()) .Returns(x => new AppDomain.Invoices.Data.Entities.Invoice { - TenantId = ((CreateInvoiceCommandHandler.DbCommand)x[0]).Invoice.TenantId, - InvoiceId = ((CreateInvoiceCommandHandler.DbCommand)x[0]).Invoice.InvoiceId, - Name = ((CreateInvoiceCommandHandler.DbCommand)x[0]).Invoice.Name, + TenantId = x.ArgAt(0).Invoice.TenantId, + InvoiceId = x.ArgAt(0).Invoice.InvoiceId, + Name = x.ArgAt(0).Invoice.Name, Status = nameof(InvoiceStatus.Draft), - Amount = ((CreateInvoiceCommandHandler.DbCommand)x[0]).Invoice.Amount, - Currency = ((CreateInvoiceCommandHandler.DbCommand)x[0]).Invoice.Currency, - DueDate = ((CreateInvoiceCommandHandler.DbCommand)x[0]).Invoice.DueDate, - CashierId = ((CreateInvoiceCommandHandler.DbCommand)x[0]).Invoice.CashierId, + Amount = x.ArgAt(0).Invoice.Amount, + Currency = x.ArgAt(0).Invoice.Currency, + DueDate = x.ArgAt(0).Invoice.DueDate, + CashierId = x.ArgAt(0).Invoice.CashierId, CreatedDateUtc = DateTime.UtcNow, UpdatedDateUtc = DateTime.UtcNow, Version = 1 // Initial version for new entity @@ -81,14 +81,14 @@ public async Task Handle_WithDefaults_ShouldUseDefaultValues() messagingMock.InvokeCommandAsync(Arg.Any(), Arg.Any()) .Returns(x => new AppDomain.Invoices.Data.Entities.Invoice { - TenantId = ((CreateInvoiceCommandHandler.DbCommand)x[0]).Invoice.TenantId, - InvoiceId = ((CreateInvoiceCommandHandler.DbCommand)x[0]).Invoice.InvoiceId, - Name = ((CreateInvoiceCommandHandler.DbCommand)x[0]).Invoice.Name, + TenantId = x.ArgAt(0).Invoice.TenantId, + InvoiceId = x.ArgAt(0).Invoice.InvoiceId, + Name = x.ArgAt(0).Invoice.Name, Status = nameof(InvoiceStatus.Draft), - Amount = ((CreateInvoiceCommandHandler.DbCommand)x[0]).Invoice.Amount, - Currency = ((CreateInvoiceCommandHandler.DbCommand)x[0]).Invoice.Currency, - DueDate = ((CreateInvoiceCommandHandler.DbCommand)x[0]).Invoice.DueDate, - CashierId = ((CreateInvoiceCommandHandler.DbCommand)x[0]).Invoice.CashierId, + Amount = x.ArgAt(0).Invoice.Amount, + Currency = x.ArgAt(0).Invoice.Currency, + DueDate = x.ArgAt(0).Invoice.DueDate, + CashierId = x.ArgAt(0).Invoice.CashierId, CreatedDateUtc = DateTime.UtcNow, UpdatedDateUtc = DateTime.UtcNow, Version = 1 // Initial version for new entity @@ -117,14 +117,14 @@ public async Task Handle_ShouldGenerateUniqueGuidForEachCall() messagingMock.InvokeCommandAsync(Arg.Any(), Arg.Any()) .Returns(x => new AppDomain.Invoices.Data.Entities.Invoice { - TenantId = ((CreateInvoiceCommandHandler.DbCommand)x[0]).Invoice.TenantId, - InvoiceId = ((CreateInvoiceCommandHandler.DbCommand)x[0]).Invoice.InvoiceId, - Name = ((CreateInvoiceCommandHandler.DbCommand)x[0]).Invoice.Name, + TenantId = x.ArgAt(0).Invoice.TenantId, + InvoiceId = x.ArgAt(0).Invoice.InvoiceId, + Name = x.ArgAt(0).Invoice.Name, Status = nameof(InvoiceStatus.Draft), - Amount = ((CreateInvoiceCommandHandler.DbCommand)x[0]).Invoice.Amount, - Currency = ((CreateInvoiceCommandHandler.DbCommand)x[0]).Invoice.Currency, - DueDate = ((CreateInvoiceCommandHandler.DbCommand)x[0]).Invoice.DueDate, - CashierId = ((CreateInvoiceCommandHandler.DbCommand)x[0]).Invoice.CashierId, + Amount = x.ArgAt(0).Invoice.Amount, + Currency = x.ArgAt(0).Invoice.Currency, + DueDate = x.ArgAt(0).Invoice.DueDate, + CashierId = x.ArgAt(0).Invoice.CashierId, CreatedDateUtc = DateTime.UtcNow, UpdatedDateUtc = DateTime.UtcNow, Version = 1 // Initial version for new entity