public async Task Should_Excute_When_No_Args() { using (var client = new TerminalClient()) { var result = await client.ExcuteAndReadOutputAsync(@"C:\", "cmd.exe", "/c dir"); Assert.NotNull(result); } }
public async Task Should_Excute_Cmd_And_Wait_Result() { using (var client = new TerminalClient(_trace)) { var result = await client.ExcuteAndReadOutputAsync(@"C:\", "cmd.exe", "/c dir"); Assert.NotNull(result); } }
public async Task Should_Excute_When_No_Cmd() { using (var client = new TerminalClient()) { var result = await client.ExcuteAndReadOutputAsync(@"C:\", "ipconfig", "/all"); Assert.NotNull(result); } }
public async Task Should_Set_Env_Variable() { var value = "Yeah it is work"; var env = new Dictionary <string, string>() { ["TestVar"] = value }; using (var client = new TerminalClient(_trace, env)) { var result = await client.ExcuteAndReadOutputAsync(@"C:\", "powershell.exe", "/c echo $Env:TestVar"); result = result .Replace("\n", "") .Replace("\r", ""); Assert.Equal(value, result); } }