-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAiPromptComposerRepairEditModeTests.cs
More file actions
31 lines (30 loc) · 1.04 KB
/
AiPromptComposerRepairEditModeTests.cs
File metadata and controls
31 lines (30 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using CoreAI.Ai;
using CoreAI.Session;
using NUnit.Framework;
namespace CoreAI.Tests.EditMode
{
public sealed class AiPromptComposerRepairEditModeTests
{
[Test]
public void BuildUserPayload_AppendsLuaRepairFields()
{
AiPromptComposer composer = new(
new BuiltInDefaultAgentSystemPromptProvider(),
new NoAgentUserPromptTemplateProvider(),
new NullLuaScriptVersionStore());
GameSessionSnapshot snap = new();
AiTaskRequest task = new()
{
RoleId = BuiltInAgentRoleIds.Programmer,
Hint = "fix",
LuaRepairGeneration = 2,
LuaRepairPreviousCode = "return x",
LuaRepairErrorMessage = "boom"
};
string u = composer.BuildUserPayload(snap, task);
StringAssert.Contains("lua_repair_generation=2", u);
StringAssert.Contains("lua_error=boom", u);
StringAssert.Contains("fix_this_lua=", u);
}
}
}