.NET Standardized!
Light.GuardClauses is now a .NET Standard 1.0 library.
Breaking Changes:
- no more conditional compilation: all assertion methods now return the value that they check, so that they can be easily chained or set on a field. COMPILE_ASSERTIONS is gone.
- Equality now only depends on IEqualityComparer. There are no assertions that directly address IEquatable or struct comparison. Just use MustBe or MustNotBe and optionally pass in an IEqualityComparer instance. This also affects most EnumerableAssertions.
Added features:
- new assertions for URIs: MustHaveOneSchemeOf, MustBeHttpUrl, MustBeHttpsUrl, and MustBeHttpOrHttpsUrl
- AsReadOnlyList takes an IEnumerable and tries to cast it to an IReadOnlyList instance. If that is not possible, a new List instance with the items of the enumerable will be returned.