2016-02-12 18:22:35 -08:00
|
|
|
|
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
|
|
|
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
|
|
|
|
2016-03-03 17:43:42 -08:00
|
|
|
|
using System;
|
|
|
|
|
|
2016-02-12 18:22:35 -08:00
|
|
|
|
namespace Microsoft.DotNet.Tools.Test
|
|
|
|
|
{
|
|
|
|
|
public class ReportingChannelFactory : IReportingChannelFactory
|
|
|
|
|
{
|
2016-03-03 17:43:42 -08:00
|
|
|
|
public event EventHandler<IReportingChannel> TestRunnerChannelCreated;
|
|
|
|
|
|
|
|
|
|
public IReportingChannel CreateTestRunnerChannel()
|
2016-02-12 18:22:35 -08:00
|
|
|
|
{
|
2016-03-03 17:43:42 -08:00
|
|
|
|
var testRunnerChannel = ReportingChannel.ListenOn(0);
|
|
|
|
|
|
|
|
|
|
TestRunnerChannelCreated?.Invoke(this, testRunnerChannel);
|
|
|
|
|
|
|
|
|
|
return testRunnerChannel;
|
2016-02-12 18:22:35 -08:00
|
|
|
|
}
|
|
|
|
|
|
2016-03-03 17:43:42 -08:00
|
|
|
|
public IReportingChannel CreateAdapterChannel(int port)
|
2016-02-12 18:22:35 -08:00
|
|
|
|
{
|
|
|
|
|
return ReportingChannel.ListenOn(port);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|