Skip to content

Commit c65250e

Browse files
committed
Don't mock
1 parent ce48672 commit c65250e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/UnitTests/MSTestAdapter.UnitTests/Helpers/ReflectHelperTests.cs

+8
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,10 @@ public void GettingAttributesShouldNotReturnInheritedAttributesWhenAskingForNonI
288288
public void ResolveExpectedExceptionShouldThrowWhenAttributeIsDefinedTwice_DifferentConcreteType()
289289
{
290290
MethodInfo testMethodInfo = typeof(DummyTestClass).GetMethod(nameof(DummyTestClass.DummyTestMethod1));
291+
292+
// Don't mock. Use the real ReflectionOperations2.
293+
_testablePlatformServiceProvider.MockReflectionOperations = null;
294+
291295
TypeInspectionException ex = Assert.ThrowsException<TypeInspectionException>(
292296
() => ReflectHelper.Instance.ResolveExpectedExceptionHelper(testMethodInfo, new("DummyName", "DummyFullClassName", "DummyAssemblyName", isAsync: false)));
293297
Assert.AreEqual("The test method DummyFullClassName.DummyName has multiple attributes derived from ExpectedExceptionBaseAttribute defined on it. Only one such attribute is allowed.", ex.Message);
@@ -296,6 +300,10 @@ public void ResolveExpectedExceptionShouldThrowWhenAttributeIsDefinedTwice_Diffe
296300
public void ResolveExpectedExceptionShouldThrowWhenAttributeIsDefinedTwice_SameConcreteType()
297301
{
298302
MethodInfo testMethodInfo = typeof(DummyTestClass).GetMethod(nameof(DummyTestClass.DummyTestMethod2));
303+
304+
// Don't mock. Use the real ReflectionOperations2.
305+
_testablePlatformServiceProvider.MockReflectionOperations = null;
306+
299307
TypeInspectionException ex = Assert.ThrowsException<TypeInspectionException>(
300308
() => ReflectHelper.Instance.ResolveExpectedExceptionHelper(testMethodInfo, new("DummyName", "DummyFullClassName", "DummyAssemblyName", isAsync: false)));
301309
Assert.AreEqual("The test method DummyFullClassName.DummyName has multiple attributes derived from ExpectedExceptionBaseAttribute defined on it. Only one such attribute is allowed.", ex.Message);

0 commit comments

Comments
 (0)