test(advice): cover the analysis job log keys in the advisor resource check
The analysis job handlers write Advisor.Log.* lines that no advisor key class lists, so the exact-count assertion failed on both CI runners. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
1 file changed
+4
-1
@@ -19,6 +19,7 @@ public sealed partial class AdvisorLocalizationTests(TestContext context)
|
|||||||
{
|
{
|
||||||
private static readonly CultureInfo English = CultureInfo.GetCultureInfo("en");
|
private static readonly CultureInfo English = CultureInfo.GetCultureInfo("en");
|
||||||
private static readonly CultureInfo Italian = CultureInfo.GetCultureInfo("it");
|
private static readonly CultureInfo Italian = CultureInfo.GetCultureInfo("it");
|
||||||
|
private const string LogPrefix = "Advisor.Log.";
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void EveryAdvisorKeyHasEnglishAndItalianTextWithTheSamePlaceholders()
|
public void EveryAdvisorKeyHasEnglishAndItalianTextWithTheSamePlaceholders()
|
||||||
@@ -26,7 +27,9 @@ public sealed partial class AdvisorLocalizationTests(TestContext context)
|
|||||||
var manager = new ResourceManager("Titano.Core.i18n.Advisor", typeof(Loc).Assembly);
|
var manager = new ResourceManager("Titano.Core.i18n.Advisor", typeof(Loc).Assembly);
|
||||||
var english = Entries(manager.GetResourceSet(CultureInfo.InvariantCulture, createIfNotExists: true, tryParents: false)!);
|
var english = Entries(manager.GetResourceSet(CultureInfo.InvariantCulture, createIfNotExists: true, tryParents: false)!);
|
||||||
var italian = Entries(manager.GetResourceSet(Italian, createIfNotExists: true, tryParents: false)!);
|
var italian = Entries(manager.GetResourceSet(Italian, createIfNotExists: true, tryParents: false)!);
|
||||||
var keys = Keys(typeof(AdvisorKeys)).Concat(Keys(typeof(FindingKeys))).Concat(Keys(typeof(DeepFindingKeys))).ToList();
|
// Job log lines (Advisor.Log.*) are written by the analysis job handlers in Titano.Data, not by the advisor itself.
|
||||||
|
var keys = Keys(typeof(AdvisorKeys)).Concat(Keys(typeof(FindingKeys))).Concat(Keys(typeof(DeepFindingKeys)))
|
||||||
|
.Concat(english.Keys.Where(k => k.StartsWith(LogPrefix, StringComparison.Ordinal))).ToList();
|
||||||
Assert.Greater(keys.Count, 90);
|
Assert.Greater(keys.Count, 90);
|
||||||
foreach (var key in keys)
|
foreach (var key in keys)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user