21 lines
456 B
C#
21 lines
456 B
C#
using McpSsh.Server.Ssh;
|
|
|
|
namespace McpSsh.Tests;
|
|
|
|
public sealed class RemoteShellCommandTests
|
|
{
|
|
[Fact]
|
|
public void Build_ReturnsCommandWhenCwdIsMissing()
|
|
{
|
|
Assert.Equal("pwd", RemoteShellCommand.Build("pwd", null));
|
|
}
|
|
|
|
[Fact]
|
|
public void Build_PrependsQuotedCwd()
|
|
{
|
|
var command = RemoteShellCommand.Build("ls", "/srv/app's/current");
|
|
|
|
Assert.Equal("cd '/srv/app'\\''s/current' && ls", command);
|
|
}
|
|
}
|