build: initial project release
All checks were successful
release / dotnet-release-workflow (push) Successful in 1m23s
All checks were successful
release / dotnet-release-workflow (push) Successful in 1m23s
This commit is contained in:
commit
48c483c568
62 changed files with 4957 additions and 0 deletions
50
src/process.tests/PathResolutionTests.cs
Normal file
50
src/process.tests/PathResolutionTests.cs
Normal 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");
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue