Shouldly
  • Overview
  • Contributing
  • Documentation
    • Getting Started
    • Configuration
    • Equality
      • ShouldBe
      • NotBe
      • Null
      • Bool
      • Flags
      • AssignableTo
      • OfType
      • OneOf
      • Greater/Less Than
      • InRange
      • MatchApproved
      • Enumerable
      • SameAs
      • String
      • ExampleClasses
    • String
      • ShouldBe
      • Match
      • Contain
      • Null and Empty
      • StartWith
      • EndWith
    • Enumerable
      • ShouldBe
      • All
      • Empty
      • OneOf
      • Contain
      • Unique
      • SubsetOf
      • Have
    • Dictionary
      • ContainKey
      • ContainKeyAndValue
    • Exceptions
      • Throw
      • NotThrow
    • SatisfyAllConditions
    • CompleteIn
    • DynamicShould
    • Upgrade 3 to 4
Powered by GitBook
On this page
  • Class constraint added to ShouldNotBeNull
  • Func<string> customMessage removed
  • Diff tool functionality moved to DiffEngine
Edit on GitHub
  1. Documentation

Upgrade 3 to 4

PreviousDynamicShould

Last updated 2 years ago

This is a work in progress. Please send a PR with any amendments.

Also see the .

Class constraint added to ShouldNotBeNull

In previous versions it was possible to assert that a non-nullable type ShouldNotBeNull, even though this logically makes no sense. For exmaple, the following would happily compile, but of course could never cause a test failure:

const long value = 1;

value.ShouldNotBeNull();

The class constraint was added to ShouldNotBeNull in v4, which means the above code will no longer compile. This is a good thing because it allows you to find and fix nonsensical tests in your codebase!

Func<string> customMessage removed

All overloads that accepted a Func<string> customMessage have been changed to string customMessage.

Diff tool functionality moved to DiffEngine

Diff tool functionality is now provided by .

As such, the following APIs have been removed:

  • Shouldly.Configuration.DiffTool

  • ShouldlyConfiguration.DiffTools

  • Shouldly.Configuration.IShouldNotLaunchDiffTool

  • Shouldly.Configuration.DiffToolConfiguration

  • Shouldly.Configuration.KnownDiffTools

  • Shouldly.Configuration.KnownDoNotLaunchStrategies

4.0 milestone
DiffEngine