build: initial project release
All checks were successful
release / dotnet-release-workflow (push) Successful in 1m23s

This commit is contained in:
Louis Seubert 2026-01-20 22:41:16 +01:00
commit 48c483c568
Signed by: louis9902
GPG key ID: 4B9DB28F826553BD
62 changed files with 4957 additions and 0 deletions

View file

@ -0,0 +1,50 @@
// Copyright (c) The Geekeey Authors
// SPDX-License-Identifier: EUPL-1.2
using Geekeey.Process.Buffered;
namespace Geekeey.Process.Tests;
internal sealed class PathResolutionTests
{
[Test]
public async Task I_can_execute_a_command_on_an_executable_using_its_short_name()
{
// Arrange
var cmd = new Command("dotnet")
.WithArguments("--version");
// Act
var result = await cmd.ExecuteBufferedAsync();
// Assert
using (Assert.Multiple())
{
await Assert.That(result.ExitCode).IsEqualTo(0);
await Assert.That(result.StandardOutput.Trim()).Matches(@"^\d+\.\d+\.\d+$");
}
}
[Test]
[Platform(PlatformAttribute.Windows)]
public async Task I_can_execute_a_command_on_a_script_using_its_short_name()
{
// Arrange
using var dir = TestTempDirectory.Create();
await File.WriteAllTextAsync(Path.Combine(dir.Path, "script.cmd"), "@echo hi");
using var _1 = TestEnvironment.ExtendPath(dir.Path);
var cmd = new Command("script");
// Act
var result = await cmd.ExecuteBufferedAsync();
// Assert
// Assert
using (Assert.Multiple())
{
await Assert.That(result.ExitCode).IsEqualTo(0);
await Assert.That(result.StandardOutput.Trim()).IsEqualTo("hi");
}
}
}