fix(cv): bind letter proposals to current sources and preserve document choices
This commit is contained in:
@@ -2,12 +2,13 @@ using JobTrackerApi.Data;
|
||||
using JobTrackerApi.Models;
|
||||
using JobTrackerApi.Services;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Moq;
|
||||
using Xunit;
|
||||
|
||||
namespace JobTrackerApi.Tests;
|
||||
|
||||
public sealed class AiWorkspaceTests
|
||||
public sealed partial class AiWorkspaceTests
|
||||
{
|
||||
private sealed class FakeAi : ISummarizerService
|
||||
{
|
||||
@@ -16,6 +17,7 @@ public sealed class AiWorkspaceTests
|
||||
public string? LastInstruction;
|
||||
public string? ActualProvider;
|
||||
public string? FallbackReason;
|
||||
public Func<Task>? BeforeReturn;
|
||||
// The source text the module assembled — what the prompt actually saw.
|
||||
public string? LastText;
|
||||
public Task<string?> SummarizeSectionAsync(string instruction, string text, int maxLength = 180, int minLength = 40)
|
||||
@@ -34,6 +36,7 @@ public sealed class AiWorkspaceTests
|
||||
CancellationToken cancellationToken = default)
|
||||
{
|
||||
var generated = await SummarizeSectionAsync(instruction, text, maxLength, minLength);
|
||||
if (BeforeReturn is not null) await BeforeReturn();
|
||||
return generated is null ? null : new AiGenerationResult(generated, ActualProvider, "test-model", FallbackReason,
|
||||
FallbackReason is null ? "local_primary" : "external_fallback");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user