-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathUtilsTests.cs
More file actions
24 lines (21 loc) · 758 Bytes
/
Copy pathUtilsTests.cs
File metadata and controls
24 lines (21 loc) · 758 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
using System.Threading.Tasks;
namespace UnityXrefMaps.Tests;
public class UtilsTests
{
[Fact]
public async Task RunCommand_SuccessfulProcess_ReturnsZero()
{
// `true` always exits with code 0.
// RunCommand must surface the exit code so callers can detect failures.
int exitCode = await Utils.RunCommand("true", "", _ => { }, _ => { });
Assert.Equal(0, exitCode);
}
[Fact]
public async Task RunCommand_FailingProcess_ReturnsNonZero()
{
// `false` always exits with code 1.
// Before the fix, RunCommand returned void so exit codes were silently discarded.
int exitCode = await Utils.RunCommand("false", "", _ => { }, _ => { });
Assert.Equal(1, exitCode);
}
}