Implements C5 + C7 from docs/Extra.md Part 2 (final wave). - Application: pure MaintenanceSuggestions.For(SystemStatus) (low system- drive space -> Disk Cleanup; uptime > 7 days -> restart) and NaturalLanguageSearch.Suggest (EN/VI phrase -> catalog keyword). Natural-language search is 100% LOCAL — no LLM, no network (golden rule #5). - WPF: Home shows a "Maintenance suggestions" section (reason + optional Open button for the suggested catalog command). The catalog search bar shows a "Did you mean: <keyword>" chip for natural-language queries; clicking it applies the keyword. - EN/VI .resx; docs (Changelog/roadmap). - Tests: NL phrase mapping (+ null/already-keyword cases) and the maintenance heuristics. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
25 lines
945 B
C#
25 lines
945 B
C#
using CommandForge.Application.Search;
|
|
|
|
namespace CommandForge.Tests;
|
|
|
|
/// <summary>Tests the local natural-language → keyword mapping (no LLM/network).</summary>
|
|
public sealed class NaturalLanguageSearchTests
|
|
{
|
|
[Theory]
|
|
[InlineData("dọn ổ đĩa", "cleanup")]
|
|
[InlineData("free space please", "cleanup")]
|
|
[InlineData("reset my network", "network")]
|
|
[InlineData("kiểm tra cập nhật", "update")]
|
|
[InlineData("battery report", "battery")]
|
|
public void Suggest_MapsNaturalPhrase_ToKeyword(string query, string expected)
|
|
=> Assert.Equal(expected, NaturalLanguageSearch.Suggest(query));
|
|
|
|
[Theory]
|
|
[InlineData("")]
|
|
[InlineData(" ")]
|
|
[InlineData("systeminfo")]
|
|
[InlineData("cleanup")] // already the keyword — don't suggest what was typed
|
|
public void Suggest_ReturnsNull_WhenNoMappingOrAlreadyKeyword(string query)
|
|
=> Assert.Null(NaturalLanguageSearch.Suggest(query));
|
|
}
|