0

I have a salt-of-the-earth test project target .net4.7.1. I installed FluentAssertions ver5.4.2 via nuget package manager of visual studio. For some reason this kind of things:

 someAction.ShouldNotThrow()

Was throwing an error about ShouldNotThrow() not being recognized. Once we rolled back to FluentAssertions nuget ver4.19.4 everything was ok. What gives? Does one have to tweak the app.config with assembly redirects of some sort or something to that effect?

XDS
  • 3,786
  • 2
  • 36
  • 56
  • 5
    When a project changes major versions (such as from 4 to 5) this is typically an indication that the API has been restructured and is not necessarily backwards compatible with existing code. Same thing here. `ShouldNotThrow()` has become `Should().NotThrow()` for consistency. This is [documented](https://www.continuousimprover.com/2018/02/fluent-assertions-50-best-unit-test.html). – Jeroen Mostert Nov 07 '18 at 11:04
  • +1 Thanks for tuning in. Can you please convert your comment over to an answer so that I can accept it? Thank in advance! – XDS Nov 07 '18 at 11:59

1 Answers1

3

Use someAction.Should().NotThrow<T>() with optional T argument for exception type. See documentation for version 5

Gerald Chifanzwa
  • 1,277
  • 7
  • 14