-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFileConversationSummaryStoreEditModeTests.cs
More file actions
40 lines (38 loc) · 1.17 KB
/
FileConversationSummaryStoreEditModeTests.cs
File metadata and controls
40 lines (38 loc) · 1.17 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
32
33
34
35
36
37
38
39
40
using System.IO;
using CoreAI.Ai;
using NUnit.Framework;
namespace CoreAI.Tests.EditMode
{
[TestFixture]
public sealed class FileConversationSummaryStoreEditModeTests
{
[Test]
public void FileConversationSummaryStore_PersistsPerRole()
{
string root = Path.Combine(Path.GetTempPath(), "CoreAITestSummary_" + Path.GetRandomFileName());
Directory.CreateDirectory(root);
try
{
FileConversationSummaryStore store = new(root, null);
const string role = "SmartChat";
store.SaveSummary(role, "line a");
Assert.AreEqual("line a", store.LoadSummary(role));
store.SaveSummary(role, "line b");
Assert.AreEqual("line b", store.LoadSummary(role));
store.ClearSummary(role);
Assert.AreEqual("", store.LoadSummary(role));
}
finally
{
try
{
Directory.Delete(root, true);
}
catch
{
/* best effort */
}
}
}
}
}