Implement PSInfisicalAPI module per design spec with env-var auto-discovery

This commit is contained in:
GraceSolutions
2026-06-02 12:46:34 -04:00
parent 3c47d6ff30
commit 430e3a00c9
80 changed files with 6361 additions and 0 deletions
@@ -0,0 +1,42 @@
using System.IO;
using System.Text.RegularExpressions;
using Xunit;
namespace PSInfisicalAPI.Tests
{
public class SourcePolicyTests
{
private static DirectoryInfo RepositoryRoot()
{
DirectoryInfo current = new DirectoryInfo(System.AppContext.BaseDirectory);
while (current != null)
{
if (File.Exists(Path.Combine(current.FullName, "PSInfisicalAPI.sln")))
{
return current;
}
current = current.Parent;
}
return null;
}
[Fact]
public void No_Async_Or_Await_Keywords_In_Production_Source()
{
DirectoryInfo root = RepositoryRoot();
Assert.NotNull(root);
DirectoryInfo src = new DirectoryInfo(Path.Combine(root.FullName, "src", "PSInfisicalAPI"));
Assert.True(src.Exists);
Regex asyncRegex = new Regex(@"\basync\b");
Regex awaitRegex = new Regex(@"\bawait\b");
foreach (FileInfo file in src.EnumerateFiles("*.cs", SearchOption.AllDirectories))
{
string content = File.ReadAllText(file.FullName);
Assert.DoesNotMatch(asyncRegex, content);
Assert.DoesNotMatch(awaitRegex, content);
}
}
}
}