Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NRE in GetDiagnosticMessage #38

Open
michael-sterling opened this issue Jan 11, 2022 · 0 comments
Open

NRE in GetDiagnosticMessage #38

michael-sterling opened this issue Jan 11, 2022 · 0 comments

Comments

@michael-sterling
Copy link
Contributor

To Repro:

[Test]
public void TestTupleContext()
{
	using (AssertEx.Context("test", (Foo: "foo", Bar: "bar")))
		AssertEx.IsTrue(() => 1 == 0);
}

Expected:

Expected: 1 == 0
Context:
    test = ("foo", "bar")

Actual:

System.NullReferenceException : Object reference not set to an instance of an object.
   at Faithlife.Testing.AssertEx.<ToString>g__Property|24_0(String name, <>c__DisplayClass24_0& ) in D:\a\FaithlifeTesting\FaithlifeTesting\src\Faithlife.Testing\AssertEx.cs:line 411
   at Faithlife.Testing.AssertEx.ToString(Object obj) in D:\a\FaithlifeTesting\FaithlifeTesting\src\Faithlife.Testing\AssertEx.cs:line 397
   at Faithlife.Testing.AssertEx.GetDiagnosticMessage(String expected, IReadOnlyCollection`1 actualValues, Exception e, IEnumerable`1 immediateContextValues) in D:\a\FaithlifeTesting\FaithlifeTesting\src\Faithlife.Testing\AssertEx.cs:line 339
   at Faithlife.Testing.AssertEx.GetDiagnosticMessage(Expression body, Exception e, IEnumerable`1 immediateContextValues) in D:\a\FaithlifeTesting\FaithlifeTesting\src\Faithlife.Testing\AssertEx.cs:line 312
   at Faithlife.Testing.AssertEx.IsTrue(Expression`1 predicateExpression) in D:\a\FaithlifeTesting\FaithlifeTesting\src\Faithlife.Testing\AssertEx.cs:line 29
@michael-sterling michael-sterling changed the title NRE NRE in GetDiagnosticMessage Jan 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant