Skip to content

Commit 3e042ff

Browse files
committed
Fixes
1 parent e175366 commit 3e042ff

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ internal async Task<TestResult[]> RunSingleTestAsync(TestMethod testMethod, IDic
140140

141141
try
142142
{
143-
testContextForTestExecution = PlatformServiceProvider.Instance.GetTestContext(testMethod, null, testContextProperties, messageLogger, UTF.UnitTestOutcome.InProgress);
143+
testContextForTestExecution = PlatformServiceProvider.Instance.GetTestContext(testMethod, null, testContextProperties, messageLogger, UnitTestOutcome.InProgress);
144144

145145
// Get the testMethod
146146
TestMethodInfo? testMethodInfo = _typeCache.GetTestMethodInfo(

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ void Action() =>
110110
new TestContextImplementation(testMethod, null, new Dictionary<string, object?>()));
111111

112112
TypeInspectionException exception = VerifyThrows<TypeInspectionException>(Action);
113-
Verify(exception.Message.StartsWith("Cannot find a valid constructor for test class 'MSTest.TestAdapter.UnitTests.Execution.TypeCacheTests+DummyTestClassWithNoDefaultConstructor'. Valid constructors are 'public' and either parameterless or with one parameter of type 'TestContext'.", StringComparison.Ordinal));
113+
Verify(exception.Message.StartsWith("Cannot find a valid constructor for test class 'MSTest.PlatformServices.Execution.UnitTests.TypeCacheTests+DummyTestClassWithNoDefaultConstructor'. Valid constructors are 'public' and either parameterless or with one parameter of type 'TestContext'.", StringComparison.Ordinal));
114114
}
115115

116116
public void GetTestMethodInfoShouldThrowIfTestContextHasATypeMismatch()

test/UnitTests/MSTest.PlatformServices.UnitTests/Extensions/MethodInfoExtensionsTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ public void GetAsyncTypeNameShouldReturnNullForVoidMethods()
299299
public void GetAsyncTypeNameShouldReturnStateMachineTypeNameForAsyncMethods()
300300
{
301301
MethodInfo methodInfo = typeof(DummyTestClass).GetMethod("PublicAsyncVoidMethod")!;
302-
Verify(methodInfo.GetAsyncTypeName()!.StartsWith("MSTest.TestAdapter.UnitTests.Extensions.MethodInfoExtensionsTests+DummyTestClass+<PublicAsyncVoidMethod>", StringComparison.Ordinal));
302+
Verify(methodInfo.GetAsyncTypeName()!.StartsWith("MSTest.PlatformServices.Extensions.UnitTests.MethodInfoExtensionsTests+DummyTestClass+<PublicAsyncVoidMethod>", StringComparison.Ordinal));
303303
}
304304

305305
#endregion
@@ -356,7 +356,7 @@ public void InvokeAsSynchronousShouldThrowIfParametersWereExpectedButWereNotProv
356356
catch (TestFailedException ex)
357357
{
358358
Verify(ex.Outcome == UTF.UnitTestOutcome.Error);
359-
Verify(ex.TryGetMessage() == string.Format(CultureInfo.InvariantCulture, Resource.CannotRunTestMethodNoDataError, "MSTest.TestAdapter.UnitTests.Extensions.MethodInfoExtensionsTests+DummyTestClass2", "PublicMethodWithParameters"));
359+
Verify(ex.TryGetMessage() == string.Format(CultureInfo.InvariantCulture, Resource.CannotRunTestMethodNoDataError, "MSTest.PlatformServices.Extensions.UnitTests.MethodInfoExtensionsTests+DummyTestClass2", "PublicMethodWithParameters"));
360360
}
361361
}
362362

@@ -383,10 +383,10 @@ public void InvokeAsSynchronousShouldThrowIfParametersWereExpectedButIncorrectCo
383383
Verify(ex.Outcome == UTF.UnitTestOutcome.Error);
384384

385385
// Error in English is:
386-
// Cannot run test method 'MSTest.TestAdapter.UnitTests.Extensions.MethodInfoExtensionsTests+DummyTestClass2.PublicMethodWithParameters': Test data doesn't match method parameters. Either the count or types are different.
386+
// Cannot run test method 'MSTest.PlatformServices.Extensions.UnitTests.MethodInfoExtensionsTests+DummyTestClass2.PublicMethodWithParameters': Test data doesn't match method parameters. Either the count or types are different.
387387
// Test expected 2 parameter(s), with types 'Int32, Int32',
388388
// but received 1 argument(s), with types 'Int32'.
389-
Verify(ex.TryGetMessage() == string.Format(CultureInfo.InvariantCulture, Resource.CannotRunTestArgumentsMismatchError, "MSTest.TestAdapter.UnitTests.Extensions.MethodInfoExtensionsTests+DummyTestClass2", "PublicMethodWithParameters",
389+
Verify(ex.TryGetMessage() == string.Format(CultureInfo.InvariantCulture, Resource.CannotRunTestArgumentsMismatchError, "MSTest.PlatformServices.Extensions.UnitTests.MethodInfoExtensionsTests+DummyTestClass2", "PublicMethodWithParameters",
390390
2, "Int32, Int32",
391391
1, "Int32"));
392392
}
@@ -406,10 +406,10 @@ public void InvokeAsSynchronousShouldThrowIfParametersWereExpectedButIncorrectTy
406406
Verify(ex.Outcome == UTF.UnitTestOutcome.Error);
407407

408408
// Error in English is:
409-
// Cannot run test method 'MSTest.TestAdapter.UnitTests.Extensions.MethodInfoExtensionsTests+DummyTestClass2.PublicMethodWithParameters': Test data doesn't match method parameters. Either the count or types are different.
409+
// Cannot run test method 'MSTest.PlatformServices.Extensions.UnitTests.MethodInfoExtensionsTests+DummyTestClass2.PublicMethodWithParameters': Test data doesn't match method parameters. Either the count or types are different.
410410
// Test expected 2 parameter(s), with types 'Int32, Int32',
411411
// but received 2 argument(s), with types 'String, String'.
412-
Verify(ex.TryGetMessage() == string.Format(CultureInfo.InvariantCulture, Resource.CannotRunTestArgumentsMismatchError, "MSTest.TestAdapter.UnitTests.Extensions.MethodInfoExtensionsTests+DummyTestClass2", "PublicMethodWithParameters",
412+
Verify(ex.TryGetMessage() == string.Format(CultureInfo.InvariantCulture, Resource.CannotRunTestArgumentsMismatchError, "MSTest.PlatformServices.Extensions.UnitTests.MethodInfoExtensionsTests+DummyTestClass2", "PublicMethodWithParameters",
413413
2, "Int32, Int32",
414414
2, "String, String"));
415415
}

0 commit comments

Comments
 (0)