-
Notifications
You must be signed in to change notification settings - Fork 731
Closed
Labels
api-approvedAPI was approved, it can be implementedAPI was approved, it can be implemented
Description
Description
Add logical implication to the available boolean assertions.
That is, a.Should().Imply(b) asserts that a → b.
This would be useful in asserting, for example, that object equality implies hash-code equality without additional logic and a better built-in "because".
Complete minimal example
Looking for something like this.
[DataTestMethod]
[DataRow(false, false)]
[DataRow(false, true)]
// failure case: [DataRow(true, false)]
[DataRow(true, true)]
public void A_Implies_B(bool a, bool b) => a.Should().Imply(b);Note this is logically equivalent to !a || b.
Additional Information
Also volunteering to add this.
Metadata
Metadata
Assignees
Labels
api-approvedAPI was approved, it can be implementedAPI was approved, it can be implemented