test(backend): cover step 17 modules and extract stubs
Add tests for partnership workflow, middleman adaptation and idea notifications; extract reusable test stubs into separate files; add architecture guard forbidding object-valued dictionaries in data contracts.
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
using TarninaHub.Application.Abstractions;
|
||||
using TarninaHub.Application.Dtos;
|
||||
|
||||
namespace TarninaHub.Tests.Stubs;
|
||||
|
||||
/// <summary>No-op INotificationService stub for controller tests.</summary>
|
||||
public sealed class StubNotificationService : INotificationService
|
||||
{
|
||||
public int StaffNotifications { get; private set; }
|
||||
|
||||
public int UserNotifications { get; private set; }
|
||||
|
||||
public Task NotifyStaffAsync(
|
||||
string type,
|
||||
IReadOnlyDictionary<string, string?> payload,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
StaffNotifications++;
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public Task NotifyUserAsync(
|
||||
string userId,
|
||||
string type,
|
||||
IReadOnlyDictionary<string, string?> payload,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
UserNotifications++;
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public Task<IReadOnlyList<NotificationResponse>> ListForUserAsync(
|
||||
string userId,
|
||||
CancellationToken cancellationToken) => Task.FromResult<IReadOnlyList<NotificationResponse>>([]);
|
||||
|
||||
public Task<NotificationResponse?> MarkReadAsync(
|
||||
string notificationId,
|
||||
string userId,
|
||||
CancellationToken cancellationToken) => Task.FromResult<NotificationResponse?>(null);
|
||||
}
|
||||
Reference in New Issue
Block a user