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:
@@ -49,7 +49,7 @@ public class ApplicationsControllerTests
|
||||
"application:new",
|
||||
"grant_call:x",
|
||||
"idea:y",
|
||||
new Dictionary<string, object?>(),
|
||||
new Dictionary<string, string?>(),
|
||||
"draft",
|
||||
DateTimeOffset.UtcNow);
|
||||
var service = new StubApplicationService(
|
||||
@@ -62,26 +62,4 @@ public class ApplicationsControllerTests
|
||||
|
||||
Assert.IsType<CreatedAtActionResult>(result.Result);
|
||||
}
|
||||
|
||||
private sealed class StubApplicationService : IApplicationService
|
||||
{
|
||||
private readonly CreateApplicationResult _createResult;
|
||||
|
||||
public StubApplicationService(CreateApplicationResult createResult)
|
||||
{
|
||||
_createResult = createResult;
|
||||
}
|
||||
|
||||
public Task<CreateApplicationResult> CreateAsync(
|
||||
string userId,
|
||||
CreateApplicationRequest request,
|
||||
CancellationToken cancellationToken) => Task.FromResult(_createResult);
|
||||
|
||||
public Task<ApplicationResponse?> GetAsync(string applicationId, CancellationToken cancellationToken) =>
|
||||
Task.FromResult(_createResult.Application);
|
||||
|
||||
public Task<IReadOnlyList<ApplicationResponse>> ListForAuthorAsync(
|
||||
string authorId,
|
||||
CancellationToken cancellationToken) => Task.FromResult<IReadOnlyList<ApplicationResponse>>([]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user