зеркало из https://github.com/mono/mono-tls.git
Let IConnection implement ITestInstance, then we can clean some stuff up.
This commit is contained in:
Родитель
6f7e424fe4
Коммит
0790baca4f
|
@ -109,6 +109,34 @@ namespace Mono.Security.Instrumentation.Framework
|
|||
Console.WriteLine ("[{0}]: {1}", GetType ().Name, string.Format (message, args));
|
||||
}
|
||||
|
||||
#region ITestInstance implementation
|
||||
|
||||
public async Task Initialize (TestContext ctx, CancellationToken cancellationToken)
|
||||
{
|
||||
ctx.LogMessage ("Initialize: {0}", this);
|
||||
await Start (ctx, cancellationToken);
|
||||
ctx.LogMessage ("Initialize #1: {0}", this);
|
||||
}
|
||||
|
||||
public Task PreRun (TestContext ctx, CancellationToken cancellationToken)
|
||||
{
|
||||
return FinishedTask;
|
||||
}
|
||||
|
||||
public Task PostRun (TestContext ctx, CancellationToken cancellationToken)
|
||||
{
|
||||
return FinishedTask;
|
||||
}
|
||||
|
||||
public Task Destroy (TestContext ctx, CancellationToken cancellationToken)
|
||||
{
|
||||
return Task.Run (() => {
|
||||
Dispose ();
|
||||
});
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public void Dispose ()
|
||||
{
|
||||
Dispose (true);
|
||||
|
|
|
@ -31,7 +31,7 @@ using Xamarin.AsyncTests;
|
|||
|
||||
namespace Mono.Security.NewTls.TestFramework
|
||||
{
|
||||
public interface IConnection : IDisposable
|
||||
public interface IConnection : ITestInstance, IDisposable
|
||||
{
|
||||
bool SupportsCleanShutdown {
|
||||
get;
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
using Xamarin.AsyncTests;
|
||||
|
||||
namespace Mono.Security.NewTls.TestFramework
|
||||
{
|
||||
public interface IServer : ICommonConnection
|
||||
|
|
|
@ -11,7 +11,7 @@ using Xamarin.AsyncTests;
|
|||
|
||||
namespace Mono.Security.NewTls.TestProvider
|
||||
{
|
||||
public abstract class Connection : IConnection, ITestInstance, IDisposable
|
||||
public abstract class Connection : IConnection, IDisposable
|
||||
{
|
||||
public abstract bool SupportsCleanShutdown {
|
||||
get;
|
||||
|
|
Загрузка…
Ссылка в новой задаче