Add integration test project with MediatR procedure tests
Added ReC.Tests project with integration tests for stored procedure commands and queries via MediatR, covering endpoints, actions, results, and profiles. Introduced a test base for DI/configuration, helper for private property access, and updated the solution to include the new test suite. Tests use NUnit and cover both positive and negative scenarios.
This commit is contained in:
22
tests/ReC.Tests/Application/Shared/ProcedureObjectHelper.cs
Normal file
22
tests/ReC.Tests/Application/Shared/ProcedureObjectHelper.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System.Reflection;
|
||||
using ReC.Application.Common.Procedures.InsertProcedure;
|
||||
using ReC.Application.Common.Procedures.UpdateProcedure;
|
||||
|
||||
namespace ReC.Tests.Application.Shared;
|
||||
|
||||
internal static class ProcedureObjectHelper
|
||||
{
|
||||
public static string? GetAddedWho(InsertObjectProcedure procedure)
|
||||
{
|
||||
return (string?)typeof(InsertObjectProcedure)
|
||||
.GetProperty("AddedWho", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public)?
|
||||
.GetValue(procedure);
|
||||
}
|
||||
|
||||
public static string? GetChangedWho(UpdateObjectProcedure procedure)
|
||||
{
|
||||
return (string?)typeof(UpdateObjectProcedure)
|
||||
.GetProperty("ChangedWho", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public)?
|
||||
.GetValue(procedure);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user