mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-12-03 11:22:01 +00:00
Co-authored-by: Thorsten Sommer <SommerEngineering@users.noreply.github.com>
35 lines
1.5 KiB
C#
35 lines
1.5 KiB
C#
using AIStudio.Tools;
|
|
|
|
namespace AIStudio.Tests.Tools;
|
|
|
|
/// <summary>
|
|
/// Checks how the prompts of the language assistants name the language the user chose.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// The Grammar & Spelling Checker, the Rewrite & Improve Text assistant, and the Translation assistant name the
|
|
/// language the same way, for a text as well as for a document. The name of a common language comes in the
|
|
/// language of the user interface, so its code follows it, and no choice leaves the prompt to name the language
|
|
/// of the text.
|
|
/// </remarks>
|
|
[TestFixture]
|
|
public sealed class CommonLanguagePromptTests
|
|
{
|
|
[Test]
|
|
public void NoChoiceNamesNoLanguage() => Assert.That(CommonLanguages.AS_IS.PromptLanguageName("Klingon"), Is.Null);
|
|
|
|
[Test]
|
|
public void ACustomLanguageIsNamedAsTheUserWroteIt() => Assert.That(CommonLanguages.OTHER.PromptLanguageName("Plattdüütsch"), Is.EqualTo("Plattdüütsch"));
|
|
|
|
[TestCase("")]
|
|
[TestCase(" ")]
|
|
public void AnEmptyCustomLanguageNamesNoLanguage(string customLanguage) => Assert.That(CommonLanguages.OTHER.PromptLanguageName(customLanguage), Is.Null);
|
|
|
|
[Test]
|
|
public void ACommonLanguageCarriesItsCode()
|
|
{
|
|
var name = CommonLanguages.DE_AT.PromptLanguageName(string.Empty);
|
|
|
|
Assert.That(name, Does.StartWith(CommonLanguages.DE_AT.Name));
|
|
Assert.That(name, Does.EndWith("(DE_AT)"), "The name follows the language of the user interface, so the code tells the model which language is meant.");
|
|
}
|
|
} |