Skip to content

Commit e175366

Browse files
committed
Fix
1 parent 0858f12 commit e175366

File tree

10 files changed

+32
-44
lines changed

10 files changed

+32
-44
lines changed

src/Adapter/MSTest.PlatformServices/Execution/TestMethodRunner.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

4-
using Microsoft.VisualStudio.TestPlatform.MSTestAdapter;
54
using Microsoft.VisualStudio.TestTools.UnitTesting;
65
using Microsoft.VisualStudio.TestTools.UnitTesting.Internal;
76

src/Adapter/MSTest.PlatformServices/Execution/UnitTestRunner.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@
33

44
using System.Security;
55

6-
using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Extensions;
7-
using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Helpers;
8-
using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel;
9-
using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices;
10-
using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Extensions;
11-
using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface;
126
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging;
137
using Microsoft.VisualStudio.TestTools.UnitTesting;
148
using Microsoft.VisualStudio.TestTools.UnitTesting.Logging;

src/Adapter/MSTest.PlatformServices/Extensions/MethodInfoExtensions.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

4-
using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Helpers;
5-
using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel;
6-
using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Extensions;
74
using Microsoft.VisualStudio.TestTools.UnitTesting;
85

96
using MSTest.PlatformServices.Helpers;

src/Adapter/MSTest.PlatformServices/Services/SettingsProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

44
#if !WINDOWS_UWP
5-
using Microsoft.VisualStudio.TestPlatform.MSTestAdapter;
5+
using MSTest.PlatformServices.Utilities;
66
#endif
77

88
using MSTest.PlatformServices.Interface;

src/Adapter/MSTest.PlatformServices/Utilities/ApplicationStateGuard.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

4-
namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter;
4+
namespace MSTest.PlatformServices.Utilities;
55

66
internal static class ApplicationStateGuard
77
{

src/Adapter/MSTest.PlatformServices/Utilities/DeploymentUtilityBase.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
#if !WINDOWS_UWP
55

6-
using Microsoft.VisualStudio.TestPlatform.MSTestAdapter;
76
using Microsoft.VisualStudio.TestPlatform.ObjectModel;
87
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter;
98
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging;

test/UnitTests/MSTest.PlatformServices.UnitTests/Execution/TestAssemblyInfoTests.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,10 @@ public void RunAssemblyInitializeShouldThrowTestFailedExceptionOnAssertionFailur
145145
Verify(exception.Outcome == UTF.UnitTestOutcome.Failed);
146146
Verify(
147147
exception.Message
148-
== "Assembly Initialization method MSTest.TestAdapter.UnitTests.Execution.TestAssemblyInfoTests+DummyTestClass.AssemblyInitializeMethod threw exception. Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException: Assert.Fail failed. Test failure. Aborting test execution.");
148+
== "Assembly Initialization method MSTest.PlatformServices.Execution.UnitTests.TestAssemblyInfoTests+DummyTestClass.AssemblyInitializeMethod threw exception. Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException: Assert.Fail failed. Test failure. Aborting test execution.");
149149
#if DEBUG
150150
Verify(exception.StackTraceInformation!.ErrorStackTrace.Contains(
151-
" at MSTest.TestAdapter.UnitTests.Execution.TestAssemblyInfoTests.<>c.<RunAssemblyInitializeShouldThrowTestFailedExceptionOnAssertionFailure>", StringComparison.Ordinal));
151+
" at MSTest.PlatformServices.Execution.UnitTests.TestAssemblyInfoTests.<>c.<RunAssemblyInitializeShouldThrowTestFailedExceptionOnAssertionFailure>", StringComparison.Ordinal));
152152
#endif
153153
Verify(exception.InnerException!.GetType() == typeof(AssertFailedException));
154154
}
@@ -162,10 +162,10 @@ public void RunAssemblyInitializeShouldThrowTestFailedExceptionWithInconclusiveO
162162
Verify(exception.Outcome == UTF.UnitTestOutcome.Inconclusive);
163163
Verify(
164164
exception.Message
165-
== "Assembly Initialization method MSTest.TestAdapter.UnitTests.Execution.TestAssemblyInfoTests+DummyTestClass.AssemblyInitializeMethod threw exception. Microsoft.VisualStudio.TestTools.UnitTesting.AssertInconclusiveException: Assert.Inconclusive failed. Test Inconclusive. Aborting test execution.");
165+
== "Assembly Initialization method MSTest.PlatformServices.Execution.UnitTests.TestAssemblyInfoTests+DummyTestClass.AssemblyInitializeMethod threw exception. Microsoft.VisualStudio.TestTools.UnitTesting.AssertInconclusiveException: Assert.Inconclusive failed. Test Inconclusive. Aborting test execution.");
166166
#if DEBUG
167167
Verify(exception.StackTraceInformation!.ErrorStackTrace.Contains(
168-
" at MSTest.TestAdapter.UnitTests.Execution.TestAssemblyInfoTests.<>c.<RunAssemblyInitializeShouldThrowTestFailedExceptionWithInconclusiveOnAssertInconclusive>", StringComparison.Ordinal));
168+
" at MSTest.PlatformServices.Execution.UnitTests.TestAssemblyInfoTests.<>c.<RunAssemblyInitializeShouldThrowTestFailedExceptionWithInconclusiveOnAssertInconclusive>", StringComparison.Ordinal));
169169
#endif
170170
Verify(exception.InnerException!.GetType() == typeof(AssertInconclusiveException));
171171
}
@@ -180,10 +180,10 @@ public void RunAssemblyInitializeShouldThrowTestFailedExceptionWithNonAssertExce
180180
Verify(exception.Outcome == UTF.UnitTestOutcome.Failed);
181181
Verify(
182182
exception.Message
183-
== "Assembly Initialization method MSTest.TestAdapter.UnitTests.Execution.TestAssemblyInfoTests+DummyTestClass.AssemblyInitializeMethod threw exception. System.ArgumentException: Some actualErrorMessage message. Aborting test execution.");
183+
== "Assembly Initialization method MSTest.PlatformServices.Execution.UnitTests.TestAssemblyInfoTests+DummyTestClass.AssemblyInitializeMethod threw exception. System.ArgumentException: Some actualErrorMessage message. Aborting test execution.");
184184
#if DEBUG
185185
Verify(exception.StackTraceInformation!.ErrorStackTrace.StartsWith(
186-
" at MSTest.TestAdapter.UnitTests.Execution.TestAssemblyInfoTests.<>c.<RunAssemblyInitializeShouldThrowTestFailedExceptionWithNonAssertExceptions>", StringComparison.Ordinal));
186+
" at MSTest.PlatformServices.Execution.UnitTests.TestAssemblyInfoTests.<>c.<RunAssemblyInitializeShouldThrowTestFailedExceptionWithNonAssertExceptions>", StringComparison.Ordinal));
187187
#endif
188188
Verify(exception.InnerException!.GetType() == typeof(ArgumentException));
189189
Verify(exception.InnerException.InnerException!.GetType() == typeof(InvalidOperationException));
@@ -203,10 +203,10 @@ public void RunAssemblyInitializeShouldThrowTheInnerMostExceptionWhenThereAreMul
203203
Verify(exception.Outcome == UTF.UnitTestOutcome.Failed);
204204
Verify(
205205
exception.Message
206-
== "Assembly Initialization method MSTest.TestAdapter.UnitTests.Execution.TestAssemblyInfoTests+DummyTestClass.AssemblyInitializeMethod threw exception. System.InvalidOperationException: I fail.. Aborting test execution.");
206+
== "Assembly Initialization method MSTest.PlatformServices.Execution.UnitTests.TestAssemblyInfoTests+DummyTestClass.AssemblyInitializeMethod threw exception. System.InvalidOperationException: I fail.. Aborting test execution.");
207207
#if DEBUG
208208
Verify(exception.StackTraceInformation!.ErrorStackTrace.StartsWith(
209-
" at MSTest.TestAdapter.UnitTests.Execution.TestAssemblyInfoTests.FailingStaticHelper..cctor()", StringComparison.Ordinal));
209+
" at MSTest.PlatformServices.Execution.UnitTests.TestAssemblyInfoTests.FailingStaticHelper..cctor()", StringComparison.Ordinal));
210210
#endif
211211
Verify(exception.InnerException!.GetType() == typeof(InvalidOperationException));
212212
}
@@ -304,7 +304,7 @@ public void RunAssemblyCleanupShouldThrowTheInnerMostExceptionWhenThereAreMultip
304304
string actualErrorMessage = _testAssemblyInfo.ExecuteAssemblyCleanup(GetTestContext())!.Message;
305305

306306
Verify(actualErrorMessage.StartsWith("Assembly Cleanup method DummyTestClass.AssemblyCleanupMethod failed. Error Message: System.InvalidOperationException: I fail.. StackTrace:", StringComparison.Ordinal));
307-
Verify(actualErrorMessage.Contains("at MSTest.TestAdapter.UnitTests.Execution.TestAssemblyInfoTests.FailingStaticHelper..cctor()"));
307+
Verify(actualErrorMessage.Contains("at MSTest.PlatformServices.Execution.UnitTests.TestAssemblyInfoTests.FailingStaticHelper..cctor()"));
308308
}
309309

310310
private static TestContextImplementation GetTestContext()

test/UnitTests/MSTest.PlatformServices.UnitTests/Execution/TestClassInfoTests.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -335,10 +335,10 @@ public void RunClassInitializeShouldThrowTestFailedExceptionOnBaseInitializeMeth
335335
Verify(exception.Outcome == UTF.UnitTestOutcome.Failed);
336336
Verify(
337337
exception.Message
338-
== "Class Initialization method MSTest.TestAdapter.UnitTests.Execution.TestClassInfoTests+DummyTestClass.InitBaseClassMethod threw exception. System.ArgumentException: Some exception message.");
338+
== "Class Initialization method MSTest.PlatformServices.Execution.UnitTests.TestClassInfoTests+DummyTestClass.InitBaseClassMethod threw exception. System.ArgumentException: Some exception message.");
339339
#if DEBUG
340340
Verify(exception.StackTraceInformation!.ErrorStackTrace.StartsWith(
341-
" at MSTest.TestAdapter.UnitTests.Execution.TestClassInfoTests.<>c.<RunClassInitializeShouldThrowTestFailedExceptionOnBaseInitializeMethodWithNonAssertExceptions>", StringComparison.Ordinal));
341+
" at MSTest.PlatformServices.Execution.UnitTests.TestClassInfoTests.<>c.<RunClassInitializeShouldThrowTestFailedExceptionOnBaseInitializeMethodWithNonAssertExceptions>", StringComparison.Ordinal));
342342
#endif
343343
Verify(exception.InnerException!.GetType() == typeof(ArgumentException));
344344
Verify(exception.InnerException.InnerException!.GetType() == typeof(InvalidOperationException));
@@ -355,10 +355,10 @@ public void RunClassInitializeShouldThrowTestFailedExceptionOnAssertionFailure()
355355
Verify(exception.Outcome == UTF.UnitTestOutcome.Failed);
356356
Verify(
357357
exception.Message
358-
== "Class Initialization method MSTest.TestAdapter.UnitTests.Execution.TestClassInfoTests+DummyTestClass.ClassInitializeMethod threw exception. Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException: Assert.Fail failed. Test failure.");
358+
== "Class Initialization method MSTest.PlatformServices.Execution.UnitTests.TestClassInfoTests+DummyTestClass.ClassInitializeMethod threw exception. Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException: Assert.Fail failed. Test failure.");
359359
#if DEBUG
360360
Verify(exception.StackTraceInformation!.ErrorStackTrace.Contains(
361-
" at MSTest.TestAdapter.UnitTests.Execution.TestClassInfoTests.<>c.<RunClassInitializeShouldThrowTestFailedExceptionOnAssertionFailure>", StringComparison.Ordinal));
361+
" at MSTest.PlatformServices.Execution.UnitTests.TestClassInfoTests.<>c.<RunClassInitializeShouldThrowTestFailedExceptionOnAssertionFailure>", StringComparison.Ordinal));
362362
#endif
363363
Verify(exception.InnerException!.GetType() == typeof(AssertFailedException));
364364
}
@@ -374,10 +374,10 @@ public void RunClassInitializeShouldThrowTestFailedExceptionWithInconclusiveOnAs
374374
Verify(exception.Outcome == UTF.UnitTestOutcome.Inconclusive);
375375
Verify(
376376
exception.Message
377-
== "Class Initialization method MSTest.TestAdapter.UnitTests.Execution.TestClassInfoTests+DummyTestClass.ClassInitializeMethod threw exception. Microsoft.VisualStudio.TestTools.UnitTesting.AssertInconclusiveException: Assert.Inconclusive failed. Test Inconclusive.");
377+
== "Class Initialization method MSTest.PlatformServices.Execution.UnitTests.TestClassInfoTests+DummyTestClass.ClassInitializeMethod threw exception. Microsoft.VisualStudio.TestTools.UnitTesting.AssertInconclusiveException: Assert.Inconclusive failed. Test Inconclusive.");
378378
#if DEBUG
379379
Verify(exception.StackTraceInformation!.ErrorStackTrace.Contains(
380-
" at MSTest.TestAdapter.UnitTests.Execution.TestClassInfoTests.<>c.<RunClassInitializeShouldThrowTestFailedExceptionWithInconclusiveOnAssertInconclusive>", StringComparison.Ordinal));
380+
" at MSTest.PlatformServices.Execution.UnitTests.TestClassInfoTests.<>c.<RunClassInitializeShouldThrowTestFailedExceptionWithInconclusiveOnAssertInconclusive>", StringComparison.Ordinal));
381381
#endif
382382
Verify(exception.InnerException!.GetType() == typeof(AssertInconclusiveException));
383383
}
@@ -393,10 +393,10 @@ public void RunClassInitializeShouldThrowTestFailedExceptionWithNonAssertExcepti
393393
Verify(exception.Outcome == UTF.UnitTestOutcome.Failed);
394394
Verify(
395395
exception.Message
396-
== "Class Initialization method MSTest.TestAdapter.UnitTests.Execution.TestClassInfoTests+DummyTestClass.ClassInitializeMethod threw exception. System.ArgumentException: Argument exception.");
396+
== "Class Initialization method MSTest.PlatformServices.Execution.UnitTests.TestClassInfoTests+DummyTestClass.ClassInitializeMethod threw exception. System.ArgumentException: Argument exception.");
397397
#if DEBUG
398398
Verify(exception.StackTraceInformation!.ErrorStackTrace.StartsWith(
399-
" at MSTest.TestAdapter.UnitTests.Execution.TestClassInfoTests.<>c.<RunClassInitializeShouldThrowTestFailedExceptionWithNonAssertExceptions>", StringComparison.Ordinal));
399+
" at MSTest.PlatformServices.Execution.UnitTests.TestClassInfoTests.<>c.<RunClassInitializeShouldThrowTestFailedExceptionWithNonAssertExceptions>", StringComparison.Ordinal));
400400
#endif
401401
}
402402

@@ -435,11 +435,11 @@ public void RunClassInitializeShouldThrowTheInnerMostExceptionWhenThereAreMultip
435435
Verify(exception.Outcome == UTF.UnitTestOutcome.Failed);
436436
Verify(
437437
exception.Message
438-
== "Class Initialization method MSTest.TestAdapter.UnitTests.Execution.TestClassInfoTests+DummyTestClass.ClassInitializeMethod threw exception. System.InvalidOperationException: I fail..");
438+
== "Class Initialization method MSTest.PlatformServices.Execution.UnitTests.TestClassInfoTests+DummyTestClass.ClassInitializeMethod threw exception. System.InvalidOperationException: I fail..");
439439
#if DEBUG
440440
Verify(
441441
exception.StackTraceInformation!.ErrorStackTrace.StartsWith(
442-
" at MSTest.TestAdapter.UnitTests.Execution.TestClassInfoTests.FailingStaticHelper..cctor()", StringComparison.Ordinal));
442+
" at MSTest.PlatformServices.Execution.UnitTests.TestClassInfoTests.FailingStaticHelper..cctor()", StringComparison.Ordinal));
443443
#endif
444444
Verify(exception.InnerException!.GetType() == typeof(InvalidOperationException));
445445
}
@@ -612,7 +612,7 @@ public void RunClassCleanupShouldThrowTheInnerMostExceptionWhenThereAreMultipleN
612612

613613
Verify(classCleanupException is not null);
614614
Verify(classCleanupException.Message.StartsWith("Class Cleanup method DummyTestClass.ClassCleanupMethod failed. Error Message: System.InvalidOperationException: I fail..", StringComparison.Ordinal));
615-
Verify(classCleanupException.Message.Contains("at MSTest.TestAdapter.UnitTests.Execution.TestClassInfoTests.FailingStaticHelper..cctor()"));
615+
Verify(classCleanupException.Message.Contains("at MSTest.PlatformServices.Execution.UnitTests.TestClassInfoTests.FailingStaticHelper..cctor()"));
616616
}
617617

618618
#endregion

0 commit comments

Comments
 (0)