From e7d21a1102bdb03be889ea7fc7d7e40f19d8c946 Mon Sep 17 00:00:00 2001 From: Sam Harwell Date: Wed, 29 Mar 2017 17:30:29 -0500 Subject: [PATCH] Allow WpfFact tests to run from Test Explorer This commit adds the necessary deserialization constructor which allows WpfFact tests to be run from Test Explorer in Visual Studio. This is very helpful for cases like debugging a unit test. --- src/EditorFeatures/TestUtilities/Threading/WpfTestCase.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/EditorFeatures/TestUtilities/Threading/WpfTestCase.cs b/src/EditorFeatures/TestUtilities/Threading/WpfTestCase.cs index 4f58caf36ce..8391dbb9bf8 100644 --- a/src/EditorFeatures/TestUtilities/Threading/WpfTestCase.cs +++ b/src/EditorFeatures/TestUtilities/Threading/WpfTestCase.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft. 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.ComponentModel; using System.Diagnostics; using System.Threading; using System.Threading.Tasks; @@ -19,6 +20,13 @@ public class WpfTestCase : XunitTestCase { private readonly SemaphoreSlim _wpfTestSerializationGate; + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Called by the de-serializer; should only be called by deriving classes for de-serialization purposes")] + public WpfTestCase() + { + _wpfTestSerializationGate = new SemaphoreSlim(1); + } + public WpfTestCase(IMessageSink diagnosticMessageSink, TestMethodDisplay defaultMethodDisplay, ITestMethod testMethod, SemaphoreSlim wpfTestSerializationGate, object[] testMethodArguments = null) : base(diagnosticMessageSink, defaultMethodDisplay, testMethod, testMethodArguments) { -- GitLab