Steeltoe icon indicating copy to clipboard operation
Steeltoe copied to clipboard

Use FluentAssertions instead of Xunit assertions

Open bart-vmware opened this issue 3 years ago • 2 comments

Refactor existing tests to use FluentAssertions instead of Assert.* methods, to get better feedback than "True should be False" when a test fails.

This can be automated using https://github.com/fluentassertions/fluentassertions.analyzers, which should be activated in sharedtest.props.

bart-vmware avatar Jul 28 '22 11:07 bart-vmware

After adding:

  <ItemGroup>
    <Using Include="FluentAssertions" />
    <Using Include="Xunit" />
  </ItemGroup>

to sharedtest.props and removing unused usings, FluentAssertions.Analyzers no longer works. It is unable to handle global namespace imports. My changes up to this point are in the next branch: https://github.com/SteeltoeOSS/Steeltoe/tree/use-fluent-assertions.

Blocked by https://github.com/fluentassertions/fluentassertions.analyzers/issues/163.

bart-vmware avatar Aug 05 '22 15:08 bart-vmware