-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathHttps.cs
More file actions
26 lines (21 loc) · 731 Bytes
/
Https.cs
File metadata and controls
26 lines (21 loc) · 731 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
25
26
using System.IO;
using System.Threading.Tasks;
namespace Https.Tests
{
public static class Https
{
public static async Task<HttpsResult> ExecuteAsync(params string[] args)
{
using var stdin = new MemoryStream();
return await ExecuteAsync(stdin, args);
}
public static async Task<HttpsResult> ExecuteAsync(Stream stdin, params string[] args)
{
var stdout = new MemoryStream();
var stderr = new MemoryStream();
var exitCode = await new Program(() => stderr, () => stdin, () => stdout, false)
.RunAsync(args);
return new HttpsResult(exitCode, stdout, stderr);
}
}
}