feat: initial project commit
Some checks failed
default / default (8.0) (push) Failing after 21s

This commit is contained in:
Louis Seubert 2024-04-27 20:15:05 +02:00
commit 4aa6c48530
Signed by: louis9902
GPG key ID: 4B9DB28F826553BD
52 changed files with 3781 additions and 0 deletions

View file

@ -0,0 +1,48 @@
using Geekeey.Extensions.Process.Buffered;
namespace Geekeey.Extensions.Process.Tests;
[TestFixture]
internal sealed class PathResolutionTests
{
[Test]
public async Task Execute_CommandUsingShortName()
{
// Arrange
var cmd = new Command("dotnet")
.WithArguments("--version");
// Act
var result = await cmd.ExecuteBufferedAsync();
// Assert
Assert.Multiple(() =>
{
Assert.That(result.IsSuccess, Is.True);
Assert.That(result.StandardOutput.Trim(), Does.Match(@"^\d+\.\d+\.\d+$"));
});
}
[Test]
[Platform("win")]
public async Task Execute_ScriptUsingShortName()
{
// 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
Assert.Multiple(() =>
{
Assert.That(result.IsSuccess, Is.True);
Assert.That(result.StandardOutput.Trim(), Is.EqualTo("hi"));
});
}
}