-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCoreAiChatConfigEditModeTests.cs
More file actions
44 lines (41 loc) · 2.49 KB
/
CoreAiChatConfigEditModeTests.cs
File metadata and controls
44 lines (41 loc) · 2.49 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
41
42
43
44
using CoreAI.Chat;
using NUnit.Framework;
using UnityEngine;
namespace CoreAI.Tests.EditMode
{
/// <summary>
/// EditMode coverage for the <see cref="CoreAiChatConfig"/> ScriptableObject
/// used by the reusable CoreAI chat panel.
/// </summary>
[TestFixture]
public sealed class CoreAiChatConfigEditModeTests
{
[Test]
public void CreateInstance_Defaults_AreSensible()
{
CoreAiChatConfig config = ScriptableObject.CreateInstance<CoreAiChatConfig>();
Assert.AreEqual("SmartChat", config.RoleId);
Assert.AreEqual("AI Chat", config.HeaderTitle);
Assert.IsFalse(string.IsNullOrEmpty(config.WelcomeMessage));
Assert.IsTrue(config.EnableStreaming, "стриминг по умолчанию включён");
Assert.AreEqual(string.Empty, config.TypingIndicatorText,
"префикс пуст → анимация индикатора показывает только точки \"...\"");
Assert.AreEqual(650, config.ChatWidth);
Assert.AreEqual(910, config.ChatHeight);
Assert.IsFalse(config.UseFullscreenChat, "по умолчанию не на весь экран");
Assert.IsFalse(config.SendOnShiftEnter,
"по умолчанию Enter отправляет, Shift+Enter вставляет перенос строки");
Assert.AreEqual(2000, config.MaxMessageLength);
Assert.IsFalse(string.IsNullOrEmpty(config.ErrorMessagePrefix));
Assert.IsFalse(string.IsNullOrEmpty(config.TimeoutMessage));
Assert.IsFalse(string.IsNullOrEmpty(config.NoResponseMessage));
Assert.IsTrue(config.LoadPersistedChatOnStartup, "по умолчанию подгружаем сохранённую историю в UI");
Assert.IsTrue(config.LongRequestHintFormat.Contains("{elapsed}"),
"шаблон подсказки должен содержать {elapsed} для подстановки секунд");
Assert.IsFalse(string.IsNullOrWhiteSpace(config.StreamingToolProgressHint),
"короткая подсказка при вызове инструмента / буфере не должна быть пустой по умолчанию");
Assert.IsFalse(config.ShowToolCallsInChat, "по умолчанию tool-call строки в чате не показываем");
Object.DestroyImmediate(config);
}
}
}