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

Xunit.Sdk.MultipleException Empty #2556

Closed
bradwilson opened this issue Jul 24, 2022 Discussed in #2517 · 0 comments
Closed

Xunit.Sdk.MultipleException Empty #2556

bradwilson opened this issue Jul 24, 2022 Discussed in #2517 · 0 comments

Comments

@bradwilson
Copy link
Member

Discussed in #2517

Originally posted by rabyjaycie14 April 26, 2022
Hi,

I'm somewhat new to using assertions, and I just came across Assert.Multiple which shipped in xunit.assert 2.4.2-pre.12 .

I'm attempting to use this new method, but am encountering an issue.

Consider this sample BUnit test, which runs on XUnit:

[Fact]
public void AssertMultiples()
{
  // Setup mocks

  // Register services

  IRenderedComponent<MyComponent> cut = RenderComponent<MyComponent>();

  IReadOnlyList <IRenderedComponent<MyChildComponent>> MyChildComponent = cut.FindComponents<MyChildComponent>();

  bool myBool = MyChildComponent[0].Instance.MyBool;
  string myString = MyChildComponent[0].Instance.MyString;

  Assert.Multiple(
	() => Assert.True(myBool),
	() => Assert.True(myString == "Hello World"!));
}

When I run the test, it results in the following:

Xunit.Sdk.MultipleException
Multiple failures were encountered:
Inner stack traces:

Upon reviewing the source code, it appears it should report every exception encountered, so I'm wondering if I'm setting up my test incorrectly?

Thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant