diff --git a/Src/FluentAssertions/Numeric/ComparableTypeAssertions.cs b/Src/FluentAssertions/Numeric/ComparableTypeAssertions.cs index b3ea048c02..1b31a3f4a2 100644 --- a/Src/FluentAssertions/Numeric/ComparableTypeAssertions.cs +++ b/Src/FluentAssertions/Numeric/ComparableTypeAssertions.cs @@ -1,6 +1,8 @@ using System; +using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; +using System.Linq; using FluentAssertions.Common; using FluentAssertions.Equivalency; using FluentAssertions.Execution; @@ -358,6 +360,41 @@ public AndConstraint BeGreaterThanOrEqualTo(T expected, string beca return new AndConstraint((TAssertions)this); } + /// + /// Asserts that a value is one of the specified . + /// + /// + /// The values that are valid. + /// + public AndConstraint BeOneOf(params T[] validValues) + { + return BeOneOf(validValues, string.Empty); + } + + /// + /// Asserts that a value is one of the specified . + /// + /// + /// The values that are valid. + /// + /// + /// A formatted phrase as is supported by explaining why the assertion + /// is needed. If the phrase does not start with the word because, it is prepended automatically. + /// + /// + /// Zero or more objects to format using the placeholders in . + /// + public AndConstraint BeOneOf(IEnumerable validValues, string because = "", + params object[] becauseArgs) + { + Execute.Assertion + .ForCondition(validValues.Any(val => Equals(Subject, val))) + .BecauseOf(because, becauseArgs) + .FailWith("Expected {context:object} to be one of {0}{reason}, but found {1}.", validValues, Subject); + + return new AndConstraint((TAssertions)this); + } + /// /// Returns the type of the subject the assertion applies on. /// diff --git a/Src/FluentAssertions/Primitives/ObjectAssertions.cs b/Src/FluentAssertions/Primitives/ObjectAssertions.cs index 91847aaa9c..8842d0babd 100644 --- a/Src/FluentAssertions/Primitives/ObjectAssertions.cs +++ b/Src/FluentAssertions/Primitives/ObjectAssertions.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Linq; using FluentAssertions.Common; using FluentAssertions.Equivalency; using FluentAssertions.Execution; @@ -222,6 +223,41 @@ public AndConstraint NotBe(TSubject unexpected, string because = "" return new AndConstraint((TAssertions)this); } + /// + /// Asserts that a value is one of the specified . + /// + /// + /// The values that are valid. + /// + public AndConstraint BeOneOf(params TSubject[] validValues) + { + return BeOneOf(validValues, string.Empty); + } + + /// + /// Asserts that a value is one of the specified . + /// + /// + /// The values that are valid. + /// + /// + /// A formatted phrase as is supported by explaining why the assertion + /// is needed. If the phrase does not start with the word because, it is prepended automatically. + /// + /// + /// Zero or more objects to format using the placeholders in . + /// + public AndConstraint BeOneOf(IEnumerable validValues, string because = "", + params object[] becauseArgs) + { + Execute.Assertion + .ForCondition(validValues.Contains(Subject)) + .BecauseOf(because, becauseArgs) + .FailWith("Expected {context:object} to be one of {0}{reason}, but found {1}.", validValues, Subject); + + return new AndConstraint((TAssertions)this); + } + /// public override bool Equals(object obj) => throw new NotSupportedException("Equals is not part of Fluent Assertions. Did you mean Be() or BeSameAs() instead?"); diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index adcff181d1..d9ee0bbaf3 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -1745,6 +1745,8 @@ namespace FluentAssertions.Numeric public FluentAssertions.AndConstraint BeLessOrEqualTo(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeLessThan(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeLessThanOrEqualTo(T expected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint BeOneOf(params T[] validValues) { } + public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeRankedEquallyTo(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBe(T unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeInRange(T minimumValue, T maximumValue, string because = "", params object[] becauseArgs) { } @@ -2101,6 +2103,8 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint Be(TSubject expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(TExpectation expectation, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(TExpectation expectation, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint BeOneOf(params TSubject[] validValues) { } + public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } public override bool Equals(object obj) { } public FluentAssertions.AndConstraint NotBe(TSubject unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEquivalentTo(TExpectation unexpected, string because = "", params object[] becauseArgs) { } @@ -2761,4 +2765,4 @@ namespace FluentAssertions.Xml public bool CanHandle(object value) { } public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } } -} \ No newline at end of file +} diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index 542d9b08ed..645fd533da 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -1770,6 +1770,8 @@ namespace FluentAssertions.Numeric public FluentAssertions.AndConstraint BeLessOrEqualTo(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeLessThan(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeLessThanOrEqualTo(T expected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint BeOneOf(params T[] validValues) { } + public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeRankedEquallyTo(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBe(T unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeInRange(T minimumValue, T maximumValue, string because = "", params object[] becauseArgs) { } @@ -2185,6 +2187,8 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint Be(TSubject expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(TExpectation expectation, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(TExpectation expectation, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint BeOneOf(params TSubject[] validValues) { } + public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } public override bool Equals(object obj) { } public FluentAssertions.AndConstraint NotBe(TSubject unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEquivalentTo(TExpectation unexpected, string because = "", params object[] becauseArgs) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netcoreapp2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netcoreapp2.1.verified.txt index f4c7eb8947..719ef3ffd9 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netcoreapp2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netcoreapp2.1.verified.txt @@ -1745,6 +1745,8 @@ namespace FluentAssertions.Numeric public FluentAssertions.AndConstraint BeLessOrEqualTo(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeLessThan(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeLessThanOrEqualTo(T expected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint BeOneOf(params T[] validValues) { } + public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeRankedEquallyTo(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBe(T unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeInRange(T minimumValue, T maximumValue, string because = "", params object[] becauseArgs) { } @@ -2101,6 +2103,8 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint Be(TSubject expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(TExpectation expectation, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(TExpectation expectation, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint BeOneOf(params TSubject[] validValues) { } + public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } public override bool Equals(object obj) { } public FluentAssertions.AndConstraint NotBe(TSubject unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEquivalentTo(TExpectation unexpected, string because = "", params object[] becauseArgs) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netcoreapp3.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netcoreapp3.0.verified.txt index f4c7eb8947..719ef3ffd9 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netcoreapp3.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netcoreapp3.0.verified.txt @@ -1745,6 +1745,8 @@ namespace FluentAssertions.Numeric public FluentAssertions.AndConstraint BeLessOrEqualTo(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeLessThan(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeLessThanOrEqualTo(T expected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint BeOneOf(params T[] validValues) { } + public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeRankedEquallyTo(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBe(T unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeInRange(T minimumValue, T maximumValue, string because = "", params object[] becauseArgs) { } @@ -2101,6 +2103,8 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint Be(TSubject expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(TExpectation expectation, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(TExpectation expectation, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint BeOneOf(params TSubject[] validValues) { } + public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } public override bool Equals(object obj) { } public FluentAssertions.AndConstraint NotBe(TSubject unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEquivalentTo(TExpectation unexpected, string because = "", params object[] becauseArgs) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt index f7520685ae..db65bed2b7 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -1696,6 +1696,8 @@ namespace FluentAssertions.Numeric public FluentAssertions.AndConstraint BeLessOrEqualTo(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeLessThan(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeLessThanOrEqualTo(T expected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint BeOneOf(params T[] validValues) { } + public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeRankedEquallyTo(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBe(T unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeInRange(T minimumValue, T maximumValue, string because = "", params object[] becauseArgs) { } @@ -2052,6 +2054,8 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint Be(TSubject expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(TExpectation expectation, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(TExpectation expectation, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint BeOneOf(params TSubject[] validValues) { } + public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } public override bool Equals(object obj) { } public FluentAssertions.AndConstraint NotBe(TSubject unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEquivalentTo(TExpectation unexpected, string because = "", params object[] becauseArgs) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt index f4c7eb8947..719ef3ffd9 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -1745,6 +1745,8 @@ namespace FluentAssertions.Numeric public FluentAssertions.AndConstraint BeLessOrEqualTo(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeLessThan(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeLessThanOrEqualTo(T expected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint BeOneOf(params T[] validValues) { } + public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeRankedEquallyTo(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBe(T unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeInRange(T minimumValue, T maximumValue, string because = "", params object[] becauseArgs) { } @@ -2101,6 +2103,8 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint Be(TSubject expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(TExpectation expectation, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(TExpectation expectation, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint BeOneOf(params TSubject[] validValues) { } + public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } public override bool Equals(object obj) { } public FluentAssertions.AndConstraint NotBe(TSubject unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEquivalentTo(TExpectation unexpected, string because = "", params object[] becauseArgs) { } diff --git a/Tests/FluentAssertions.Specs/Numeric/ComparableSpecs.cs b/Tests/FluentAssertions.Specs/Numeric/ComparableSpecs.cs index 728dfe7e44..e1b54937e7 100644 --- a/Tests/FluentAssertions.Specs/Numeric/ComparableSpecs.cs +++ b/Tests/FluentAssertions.Specs/Numeric/ComparableSpecs.cs @@ -103,6 +103,67 @@ public void When_two_unequal_objects_should_not_be_equal_it_should_not_throw() } } + public class BeOneOf + { + [Fact] + public void When_a_value_is_not_one_of_the_specified_values_it_should_throw() + { + // Arrange + var value = new ComparableOfInt(3); + + // Act + Action act = () => value.Should().BeOneOf(new ComparableOfInt(4), new ComparableOfInt(5)); + + // Assert + act + .Should().Throw() + .WithMessage("Expected value to be one of {4, 5}, but found 3."); + } + + [Fact] + public void When_a_value_is_not_one_of_the_specified_values_it_should_throw_with_descriptive_message() + { + // Arrange + var value = new ComparableOfInt(3); + + // Act + Action act = () => value.Should().BeOneOf(new[] { new ComparableOfInt(4), new ComparableOfInt(5) }, "because those are the valid values"); + + // Assert + act + .Should().Throw() + .WithMessage("Expected value to be one of {4, 5} because those are the valid values, but found 3."); + } + + [Fact] + public void When_a_value_is_comparable_to_but_a_different_instance_of_one_of_the_specified_values_it_should_fail() + { + // Arrange + var value = new ComparableOfInt(4); + + // Act + Action act = () => value.Should().BeOneOf(new ComparableOfInt(4), new ComparableOfInt(5)); + + // Assert + act + .Should().Throw() + .WithMessage("Expected value to be one of {4, 5}, but found 4."); + } + + [Fact] + public void When_a_value_is_the_same_instance_as_one_of_the_specified_values_it_should_succeed() + { + // Arrange + var value = new ComparableOfInt(4); + + // Act + Action act = () => value.Should().BeOneOf(value, new ComparableOfInt(5)); + + // Assert + act.Should().NotThrow(); + } + } + public class BeEquivalentTo { [Fact] diff --git a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.cs index 91a9715f2a..2880ce8c6c 100644 --- a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.cs @@ -7,6 +7,7 @@ using FluentAssertions.Execution; using FluentAssertions.Extensions; using FluentAssertions.Primitives; +using FluentAssertions.Specs.Numeric; using Xunit; using Xunit.Sdk; @@ -146,6 +147,52 @@ public void When_two_equal_objects_are_expected_not_to_be_equal_it_should_fail_a } } + public class BeOneOf + { + [Fact] + public void When_a_value_is_not_one_of_the_specified_values_it_should_throw() + { + // Arrange + var value = new ClassWithCustomEqualMethod(3); + + // Act + Action act = () => value.Should().BeOneOf(new ClassWithCustomEqualMethod(4), new ClassWithCustomEqualMethod(5)); + + // Assert + act + .Should().Throw() + .WithMessage("Expected value to be one of {ClassWithCustomEqualMethod(4), ClassWithCustomEqualMethod(5)}, but found ClassWithCustomEqualMethod(3)."); + } + + [Fact] + public void When_a_value_is_not_one_of_the_specified_values_it_should_throw_with_descriptive_message() + { + // Arrange + var value = new ClassWithCustomEqualMethod(3); + + // Act + Action act = () => value.Should().BeOneOf(new[] { new ClassWithCustomEqualMethod(4), new ClassWithCustomEqualMethod(5) }, "because those are the valid values"); + + // Assert + act + .Should().Throw() + .WithMessage("Expected value to be one of {ClassWithCustomEqualMethod(4), ClassWithCustomEqualMethod(5)} because those are the valid values, but found ClassWithCustomEqualMethod(3)."); + } + + [Fact] + public void When_a_value_is_one_of_the_specified_values_it_should_succeed() + { + // Arrange + var value = new ClassWithCustomEqualMethod(4); + + // Act + Action act = () => value.Should().BeOneOf(new ClassWithCustomEqualMethod(4), new ClassWithCustomEqualMethod(5)); + + // Assert + act.Should().NotThrow(); + } + } + private enum MyEnum { One = 1, diff --git a/docs/_pages/basicassertions.md b/docs/_pages/basicassertions.md index fdbcf35406..d47b67e12d 100644 --- a/docs/_pages/basicassertions.md +++ b/docs/_pages/basicassertions.md @@ -35,6 +35,12 @@ theObject.Should().Be(otherObject, "because they have the same values"); theObject.Should().NotBe(otherObject); ``` +To assert that an object is equal to one of the provided objects, you can use + +```csharp +theObject.Should().BeOneOf(obj1, obj2, obj3); +``` + If you want to make sure two objects are not just functionally equal but refer to the exact same object in memory, use the following two methods. ```csharp diff --git a/docs/_pages/numerictypes.md b/docs/_pages/numerictypes.md index b95cdac555..28f6f54a91 100644 --- a/docs/_pages/numerictypes.md +++ b/docs/_pages/numerictypes.md @@ -54,8 +54,8 @@ value.Should().NotBeApproximately(2.5F, 0.5F); This will verify that the value of the float is not between 2.0 and 3.0. -To assert that a value matches one of the provided values, you can do this. +To assert that a value matches one of the provided values, you can do this (works for numeric types and `IComparable`s). ```csharp -value.Should().BeOneOf(new[] { 3, 6}); +value.Should().BeOneOf(new[] { 3, 6 }); ``` diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 9b1fc15428..3b4d584c8c 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -10,6 +10,7 @@ sidebar: ## Unreleased ### What's new +* Added `BeOneOf` methods for object comparisons and `IComparable`s - [#2028](https://github.com/fluentassertions/fluentassertions/pull/2028) * Added `BeCloseTo` and `NotBeCloseTo` to `TimeOnly` - [#2030](https://github.com/fluentassertions/fluentassertions/pull/2030) ## 6.8.0