Refactor tests to send commands directly to mediator

Refactored test code to remove ToObjectProcedure usage and send command objects directly to the mediator. Updated update procedure tests to use Data and Id properties. Replaced custom Execute*Procedure methods with sender.Send. Cleaned up unused usings. These changes improve consistency and reflect updates to command structures.
This commit is contained in:
2026-03-24 11:29:15 +01:00
parent 3e10176d98
commit 302fee4908
7 changed files with 28 additions and 52 deletions

View File

@@ -27,7 +27,7 @@ public class ProcedureExecutionTests : RecApplicationTestBase
var (sender, scope) = CreateScopedSender();
using var _ = scope;
var result = await sender.ExecuteInsertProcedure(procedure, "ReC.Tests");
var result = await sender.Send(procedure);
Assert.That(result, Is.GreaterThan(0));
}
@@ -35,11 +35,11 @@ public class ProcedureExecutionTests : RecApplicationTestBase
[Test]
public async Task ExecuteUpdateProcedure_runs_with_changedWho()
{
var procedure = new UpdateProfileProcedure { Name = "updated" };
var procedure = new UpdateProfileProcedure { Data = { Name = "updated" }, Id = 123 };
var (sender, scope) = CreateScopedSender();
using var _ = scope;
var result = await sender.ExecuteUpdateProcedure(procedure, 123, "ReC.Tests");
var result = await sender.Send(procedure);
Assert.That(result, Is.Not.EqualTo(default(int)));
}
@@ -51,7 +51,7 @@ public class ProcedureExecutionTests : RecApplicationTestBase
var (sender, scope) = CreateScopedSender();
using var _ = scope;
var result = await sender.ExecuteDeleteProcedure(procedure);
var result = await sender.Send(procedure);
Assert.That(result, Is.Not.EqualTo(default(int)));
}