更新
更旧
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Threading.Tasks;
using Xunit.Abstractions;
namespace InteropTests.Helpers
{
public class InteropTestsFixture : IDisposable
{
private WebsiteProcess _process;
public string Path { get; set; }
public string ServerPort { get; private set; }
public async Task EnsureStarted(ITestOutputHelper output)
{
if (_process != null)
{
return;
}
if (string.IsNullOrEmpty(Path))
{
throw new InvalidOperationException("Path has not been set.");
}
_process = new WebsiteProcess(Path, output);
await _process.WaitForReady();
ServerPort = _process.ServerPort;
}
public void Dispose()
{
_process.Dispose();
}
}
}