From 64437e131882ee1d07d862debc9ca38a74b07224 Mon Sep 17 00:00:00 2001 From: Martin Baulig Date: Thu, 10 Sep 2015 17:32:03 +0200 Subject: [PATCH] Move the NewTlsTestFeatures dependency registration out of Mono.Security.NewTls.TestProvider. --- .../MacDependencyProvider.cs | 2 +- .../NewTlsDependencyProvider.cs | 3 --- Mono.Security.NewTls.Tests/NewTlsTestFeatures.cs | 13 +++++++++++++ 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Mac/Mono.Security.NewTls.Mac/MacDependencyProvider.cs b/Mac/Mono.Security.NewTls.Mac/MacDependencyProvider.cs index 68480b0..aae4cf1 100644 --- a/Mac/Mono.Security.NewTls.Mac/MacDependencyProvider.cs +++ b/Mac/Mono.Security.NewTls.Mac/MacDependencyProvider.cs @@ -30,12 +30,12 @@ using Xamarin.AsyncTests.MacUI; using AppKit; [assembly: AsyncTestSuite (typeof (Mono.Security.NewTls.Tests.NewTlsTestFeatures), true)] - [assembly: DependencyProvider (typeof (Mono.Security.NewTls.Mac.MacDependencyProvider))] namespace Mono.Security.NewTls.Mac { using TestProvider; + using Tests; public class MacDependencyProvider : IDependencyProvider { diff --git a/Mono.Security.NewTls.TestProvider/NewTlsDependencyProvider.cs b/Mono.Security.NewTls.TestProvider/NewTlsDependencyProvider.cs index a650c65..2615dd3 100644 --- a/Mono.Security.NewTls.TestProvider/NewTlsDependencyProvider.cs +++ b/Mono.Security.NewTls.TestProvider/NewTlsDependencyProvider.cs @@ -41,7 +41,6 @@ using Mono.Security.Providers.NewTls; namespace Mono.Security.NewTls.TestProvider { using TestFramework; - using Tests; public sealed class NewTlsDependencyProvider : IDependencyProvider { @@ -61,8 +60,6 @@ namespace Mono.Security.NewTls.TestProvider DependencyInjector.RegisterDependency (() => new CryptoProvider ()); - DependencyInjector.RegisterDependency (() => new NewTlsTestFeatures ()); - ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12; } } diff --git a/Mono.Security.NewTls.Tests/NewTlsTestFeatures.cs b/Mono.Security.NewTls.Tests/NewTlsTestFeatures.cs index 9f9d2bc..0ddae18 100644 --- a/Mono.Security.NewTls.Tests/NewTlsTestFeatures.cs +++ b/Mono.Security.NewTls.Tests/NewTlsTestFeatures.cs @@ -24,9 +24,11 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; +using System.Threading; using System.Collections.Generic; using Mono.Security.NewTls.TestFramework; using Xamarin.AsyncTests; +using Xamarin.AsyncTests.Portable; using Xamarin.WebTests.Portable; using Xamarin.WebTests.HttpFramework; using Xamarin.WebTests.ConnectionFramework; @@ -35,8 +37,11 @@ using Xamarin.WebTests.Providers; using Xamarin.WebTests.Resources; [assembly: AsyncTestSuite (typeof (Mono.Security.NewTls.Tests.NewTlsTestFeatures))] +[assembly: DependencyProvider (typeof (Mono.Security.NewTls.Tests.NewTlsTestFeaturesProvider))] [assembly: RequireDependency (typeof (ConnectionProviderFactory))] [assembly: RequireDependency (typeof (ICryptoProvider))] +[assembly: RequireDependency (typeof (ICertificateProvider))] +[assembly: RequireDependency (typeof (IPortableSupport))] [assembly: RequireDependency (typeof (IPortableWebSupport))] namespace Mono.Security.NewTls.Tests @@ -51,6 +56,14 @@ namespace Mono.Security.NewTls.Tests } } + public class NewTlsTestFeaturesProvider : IDependencyProvider + { + public void Initialize () + { + DependencyInjector.RegisterDependency (() => new NewTlsTestFeatures ()); + } + } + public class NewTlsTestFeatures : SharedWebTestFeatures { public static NewTlsTestFeatures Instance {