SteeltoeOSS / Steeltoe

.NET Components for Externalized Configuration, Database Connectors, Service Discovery, Logging and Distributed Tracing, Application Management, Security, and more.
https://steeltoe.io
Apache License 2.0
1.01k stars 163 forks source link

Use FluentAssertions instead of Xunit assertions #931

Open bart-vmware opened 2 years ago

bart-vmware commented 2 years ago

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 commented 2 years ago

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.