Skip to content

Commit 5151f1a

Browse files
committed
Merge pull request #6781 from KevinH-MS/EETestLoc
Fix hard-coded error message in DynamicView tests...
2 parents f1798d1 + 91e9274 commit 5151f1a

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

src/ExpressionEvaluator/CSharp/Test/ResultProvider/DynamicViewTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public void NoMembers()
135135
Verify(dynamicView,
136136
EvalResult(Resources.DynamicView, Resources.DynamicViewValueWarning, "", "o, dynamic", DkmEvaluationResultFlags.Expandable | DkmEvaluationResultFlags.ReadOnly));
137137
Verify(GetChildren(dynamicView),
138-
EvalFailedResult(Resources.ErrorName, "No further information on this object could be discovered"));
138+
EvalFailedResult(Resources.ErrorName, DynamicDebugViewEmptyMessage));
139139
}
140140

141141
[Fact]

src/ExpressionEvaluator/Core/Test/ResultProvider/ResultProviderTestBase.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
using Microsoft.VisualStudio.Debugger.Evaluation;
1313
using Microsoft.VisualStudio.Debugger.Evaluation.ClrCompilation;
1414
using Xunit;
15-
using System.Collections;
1615

1716
namespace Microsoft.CodeAnalysis.ExpressionEvaluator
1817
{
@@ -23,6 +22,16 @@ public abstract class ResultProviderTestBase
2322

2423
internal readonly DkmInspectionContext DefaultInspectionContext;
2524

25+
protected static readonly string DynamicDebugViewEmptyMessage;
26+
27+
static ResultProviderTestBase()
28+
{
29+
var exceptionType = typeof(Microsoft.CSharp.RuntimeBinder.RuntimeBinderException).Assembly.GetType(
30+
"Microsoft.CSharp.RuntimeBinder.DynamicMetaObjectProviderDebugView+DynamicDebugViewEmptyException");
31+
var emptyProperty = exceptionType.GetProperty("Empty");
32+
DynamicDebugViewEmptyMessage = (string)emptyProperty.GetValue(exceptionType.Instantiate());
33+
}
34+
2635
protected ResultProviderTestBase(ResultProvider resultProvider, DkmInspectionContext defaultInspectionContext)
2736
{
2837
_formatter = resultProvider.Formatter;

src/ExpressionEvaluator/VisualBasic/Test/ResultProvider/DynamicViewTests.vb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.ExpressionEvaluator
128128
Verify(dynamicView,
129129
EvalResult(Resources.DynamicView, Resources.DynamicViewValueWarning, "", "o, dynamic", DkmEvaluationResultFlags.Expandable Or DkmEvaluationResultFlags.ReadOnly))
130130
Verify(GetChildren(dynamicView),
131-
EvalFailedResult(Resources.ErrorName, "No further information on this object could be discovered"))
131+
EvalFailedResult(Resources.ErrorName, DynamicDebugViewEmptyMessage))
132132
End Sub
133133

134134
<Fact>

0 commit comments

Comments
 (0)