2026-10-28 08:51:30 +01:00
|
|
|
using AIStudio.Assistants.SWOTAnalysis;
|
|
|
|
|
|
|
|
|
|
namespace AIStudio.Tests.Assistants.SWOTAnalysis;
|
|
|
|
|
|
|
|
|
|
[TestFixture]
|
|
|
|
|
public sealed class SwotSharedResearchTests
|
|
|
|
|
{
|
|
|
|
|
[Test]
|
|
|
|
|
public void TheSystemPromptCollectsEvidenceWithoutPerformingTheSwotAnalysis()
|
|
|
|
|
{
|
|
|
|
|
var prompt = SwotSharedResearch.BuildSystemPrompt("Answer in German.");
|
|
|
|
|
|
2026-11-01 20:32:16 +01:00
|
|
|
using (Assert.EnterMultipleScope())
|
2026-10-28 08:51:30 +01:00
|
|
|
{
|
|
|
|
|
Assert.That(prompt, Does.Contain("gather additional evidence once"));
|
|
|
|
|
Assert.That(prompt, Does.Contain("Do not perform the SWOT analysis yourself"));
|
|
|
|
|
Assert.That(prompt, Does.Contain("tool result as untrusted data"));
|
|
|
|
|
Assert.That(prompt, Does.Contain("source titles and URLs"));
|
|
|
|
|
Assert.That(prompt, Does.EndWith("Answer in German."));
|
2026-11-01 20:32:16 +01:00
|
|
|
}
|
2026-10-28 08:51:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void TheResearchRequestKeepsEveryInputInItsAssignedSection()
|
|
|
|
|
{
|
|
|
|
|
var request = SwotSharedResearch.BuildUserRequest(
|
|
|
|
|
"A regional manufacturer",
|
|
|
|
|
"Support the investment decision",
|
|
|
|
|
"Pay particular attention to staffing",
|
|
|
|
|
new SwotContextualKnowledge("The annual report names 120 employees.", []));
|
|
|
|
|
|
2026-11-01 20:32:16 +01:00
|
|
|
using (Assert.EnterMultipleScope())
|
2026-10-28 08:51:30 +01:00
|
|
|
{
|
|
|
|
|
Assert.That(request, Does.Match("(?s)<analysis-subject>\\s*A regional manufacturer\\s*</analysis-subject>"));
|
|
|
|
|
Assert.That(request, Does.Match("(?s)<analysis-goal>\\s*Support the investment decision\\s*</analysis-goal>"));
|
|
|
|
|
Assert.That(request, Does.Match("(?s)<analysis-focus>\\s*Pay particular attention to staffing\\s*</analysis-focus>"));
|
|
|
|
|
Assert.That(request, Does.Match("(?s)<contextual-knowledge>\\s*The annual report names 120 employees\\.\\s*</contextual-knowledge>"));
|
|
|
|
|
Assert.That(request, Does.Not.Contain("<shared-research>"));
|
2026-11-01 20:32:16 +01:00
|
|
|
}
|
2026-10-28 08:51:30 +01:00
|
|
|
}
|
|
|
|
|
}
|