Added the BeyondFacts Lab as a prototype (#1175)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2026-11-08 19:49:46 +01:00
1 parent db8dae1cf6
commit b6c3fbb5db
90 files changed
+5936 -209

No files matched your search

+47
View File
@@ -0,0 +1,47 @@
using AIStudio.Tools;
namespace AIStudio.Tests.Tools;
/// <summary>
/// Checks how AI Studio reads the files which come with it.
/// </summary>
/// <remarks>
/// The tests run a development build, which reads the files from its output folder: the project file copies every
/// embedded file there as well.
/// </remarks>
[TestFixture]
public sealed class AppResourcesTests
{
[Test]
public async Task AFileOfTheAppIsRead()
{
var text = await AppResources.ReadTextAsync("Assistants/PromptOptimizer/prompting_guideline.md");
Assert.That(text, Is.Not.Empty);
}
[Test]
public async Task BackslashesAndOuterSlashesAreAccepted()
{
var withSlashes = await AppResources.ReadTextAsync("Assistants/PromptOptimizer/prompting_guideline.md");
var withBackslashes = await AppResources.ReadTextAsync("/Assistants\\PromptOptimizer\\prompting_guideline.md");
Assert.That(withBackslashes, Is.EqualTo(withSlashes));
}
[Test]
public async Task AMissingFileGivesAnEmptyText()
{
var text = await AppResources.ReadTextAsync("Assistants/PromptOptimizer/does-not-exist.md");
Assert.That(text, Is.Empty);
}
[Test]
public void AFolderOfTheAppListsItsFiles()
{
var provider = AppResources.FolderProvider("Assistants/PromptOptimizer");
Assert.That(provider.GetDirectoryContents(string.Empty).Select(file => file.Name), Does.Contain("prompting_guideline.md"));
}
}