Skip to content

Commit

Permalink
add docs and release notes
Browse files Browse the repository at this point in the history
  • Loading branch information
nycdotnet committed Oct 6, 2022
1 parent 08bab9c commit 8960b89
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/_pages/basicassertions.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,15 @@ Internally, `BeBinarySerializable` uses the [Object graph comparison](objectgrap
theObject.Should().BeBinarySerializable<MyClass>(
options => options.Excluding(s => s.SomeNonSerializableProperty));
```

### Don't use Equals() ###

The creators of FluentAssertions designed the library to be used with its own assertion methods like `Be()`, `BeSameAs()`, etc. To help ensure that our users use FluentAssertions properly, this library will throw a specific exception when it detects the use of `Equals()` where an assertion should be. If you receive any of the below exception messages, your test code used `Equals()` where it should instead be using `Be()`, `BeSameAs()`, or one of FluentAssertions' other assertion methods.

* `Equals is not part of Fluent Assertions. Did you mean Be() or BeSameAs() instead?`
* `Equals is not part of Fluent Assertions. Did you mean Be() instead?`
* `Equals is not part of Fluent Assertions. Did you mean BeSameAs() or Equal() instead?`
* `Equals is not part of Fluent Assertions. Did you mean Before() or After() instead?`
* `Equals is not part of Fluent Assertions. Did you mean BeLessThanOrEqualTo() or BeGreaterThanOrEqualTo() instead?`
* `Equals is not part of Fluent Assertions. Did you mean CompleteWithinAsync() instead?`
* `Calling Equals on Assertion classes is not supported.` (legacy)
1 change: 1 addition & 0 deletions docs/_pages/releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ sidebar:
* Added `NotCompleteWithinAsync` for assertions on `Task` - [#1967](https://github.com/fluentassertions/fluentassertions/pull/1967)
* Added `CompleteWithinAsync` and `NotCompleteWithinAsync` for non-generic `TaskCompletionSource` (.NET 6 and above) - [#1961](https://github.com/fluentassertions/fluentassertions/pull/1961)
* Added a `ParentType` to `IObjectInfo` to help determining the parent in a call to `Using`/`When` constructs - [#1950](https://github.com/fluentassertions/fluentassertions/pull/1950)
* Updated exception messages to provide suggestions when incorrectly using `Equals()`. [#2006](https://github.com/fluentassertions/fluentassertions/pull/2006)

### Fixes
* Fixed `For`/`Exclude` not excluding properties in objects in a collection - [#1953](https://github.com/fluentassertions/fluentassertions/pull/1953)
Expand Down

0 comments on commit 8960b89

Please sign in to comment.